给你试了一下午才试出来,原来active的消息是Windows自定义的是b000就是45056
看看我的代码 ; [
][
][
]
unit Unit1;
interface
uses
; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
; StdCtrls;
type
; TForm1 = class(TForm)
; ; Button1: TButton;
; ; Memo1: TMemo;
; ; procedure FormCreate(Sender: TObject);
; private
; ; { Private declarations }
; public
; ; procedure MyProcessMsg( var Msg: TMsg; var Handled: boolean );
; ; { Public declarations }
; end;
var
; Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.MyProcessMsg(var Msg: TMsg; var Handled: boolean);
begin
; if msg.message=45056 then
; ; ShowMessage('Form Activate');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
; application.onmessage:= MyProcessMsg;
end;
end.