如果在钩子中分离出最小化消息

解决方案 »

  1.   

    unit Unit1;interfaceuses
      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.