要让from在最小化时触发事件~~要写在哪?

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TForm1 = class(TForm)
      private
        { Private declarations }
      public
        procedure WMMINIMIZE(var Msg: TMessage);message WM_SYSCOMMAND;
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.WMMINIMIZE(var Msg: TMessage);
    begin
      if Msg.WParam = SC_MINIMIZE then
        ShowMessage('a')
    end;end.
      

  2.   

    同意:pankun(剑神一笑)的确要用消息处理
      

  3.   

    拖一个Additional中的ApplicationEvents控件,在OnMinimize事件中写要处理的代码即可