delphi SendMessage 发送对象 例子
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
const
wwww_1 = WM_USER + 1111;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure DoMsg(var amsg: TMessage); message wwww_1;
end;
TTest1 = class(tobject)
private
FText: string;
public
procedure ShowMsg;
property Text: string read FText write FText;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
vObj: TTest1;
begin
vObj := TTest1.Create;
try
vObj.text := 'in tes