R
rrr
Unregistered / Unconfirmed
GUEST, unregistred user!
代碼如下:
unit Unit1;
interface
uses
; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
; StdCtrls;
const WM_abc = WM_user + 234;
type
; TForm1 = class(TForm)
; ; Button1: TButton;
; ; Memo1: TMemo;
; ; procedure Button1Click(Sender: TObject);
; ; procedure FormCreate(Sender: TObject);
; private
; ; { Private declarations }
; ; procedure MyProcessMsg( var Msg: TMsg; var Handled: boolean );
; public
; ; { Public declarations }
; end;
var
; Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
; ; sendMessage( form1.handle , wm_abc , 0 , 0 );
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
; ; Application.OnMessage := MyProcessMsg;
end;
procedure TForm1.MyProcessMsg(var Msg: TMsg; var Handled: boolean);
begin
; ; if Msg.message = wm_abc then
; ; ; ;Memo1.Lines.Add( ' You name is abc ');
end;
end.
unit Unit1;
interface
uses
; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
; StdCtrls;
const WM_abc = WM_user + 234;
type
; TForm1 = class(TForm)
; ; Button1: TButton;
; ; Memo1: TMemo;
; ; procedure Button1Click(Sender: TObject);
; ; procedure FormCreate(Sender: TObject);
; private
; ; { Private declarations }
; ; procedure MyProcessMsg( var Msg: TMsg; var Handled: boolean );
; public
; ; { Public declarations }
; end;
var
; Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
; ; sendMessage( form1.handle , wm_abc , 0 , 0 );
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
; ; Application.OnMessage := MyProcessMsg;
end;
procedure TForm1.MyProcessMsg(var Msg: TMsg; var Handled: boolean);
begin
; ; if Msg.message = wm_abc then
; ; ; ;Memo1.Lines.Add( ' You name is abc ');
end;
end.