能力值:
( LV4,RANK:50 )
|
-
-
2 楼
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
const WM_COMMNOTIFY = WM_USER + 12;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
Procedure MsgComm(Var Msg:Tmessage); Message WM_COMMNOTIFY;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.Add('begining');
Memo1.Lines.Add('The End');
PostMessage(Form1.Handle,WM_COMMNOTIFY,0,0);
end;
Procedure TForm1.MsgComm(Var Msg:Tmessage);
begin
Memo1.Lines.Add('User');
end;
end.
拿我这个直接贴PAS文件中试一下,对了加两上控件,memo1,button1;
我在DELPHI5下一点问题也没有
用sendmessage试一下
|
能力值:
( LV8,RANK:130 )
|
-
-
3 楼
delphi不懂, 南蛮妈妈帮你顶
|
|
|