问个基础问题如何编写当击窗体右上角的最小化时执行一个事件

解决方案 »

  1.   

    拦截最小化的消息!
    unit   Unit1; interface uses 
        Windows,   Messages,   SysUtils,   Variants,   Classes,   Graphics,   Controls,   Forms, 
        Dialogs,   StdCtrls,   Buttons,   CheckLst; type 
        TForm1   =   class(TForm) 
        private 
            {   Private   declarations   } 
            procedure   WMSysCommand(var   Message:Tmessage); 
            message   WM_SYSCOMMAND; 
        public 
            {   Public   declarations   } 
        end; var 
        Form1:   TForm1; implementation {$R   *.dfm} 
    procedure   TForm1.WMSysCommand(var   Message:Tmessage); 
      begin 
        if   Message.WParam=SC_MINIMIZE   then   Exit   //   拦截一下~~ 
        else   inherited; 
      end; 
    end.
    从别处抄的,应该没什么问题!
      

  2.   

    编写application.onminimize事件。。
      

  3.   

    nm_wyh 
    (冰河) 谢谢你的方法,我解决了
      

  4.   

    该问题已解决
    若有再想研究可以再看看如下帖子
    http://topic.csdn.net/u/20120928/17/07a5800e-e4e0-4b00-bd2d-9ff499397d18.html
    答案就在其中的