delphi WM_COPYDATA的应用


本文整理自网络,侵删。

 type
TMyRecord = packed record
b: Boolean; s: string[255];
end;
PMyRecord = ^TMyRecord;

procedure TForm1.Button1Click(Sender: TObject);
var
MyRecord: PMyRecord;
cds: TCopyDataStruct;
hWnd: THandle;
begin
GetMem(MyRecord, sizeof(TMyRecord));
try
MyRecord.b := True;
MyRecord.s := 'Hello world';
cds.dwData := 0;
cds.cbData := sizeof(TMyRecord);
cds.lpData := MyRecord;
hWnd := FindWindow(nil, 'Receiver');
SendMessage(hWnd, WM_COPYDATA, Handle, Integer(@cds));
finally
FreeMem(MyRecord, sizeof(TMyRecord));
end;
end;

相关阅读 >>

Delphi判断线程是否释放

Delphi xe5 android 开发实现手机打电话和发短信

Delphi searchbox1 基本用法

Delphi 判断当前活动窗口

Delphi 取得当前运行窗口的标题

Delphi ado通用操作数据单元

Delphi excel数据导入数据库表

Delphi httpresponsestrings

Delphi 获取计算机串口列表

Delphi unigui unistringgrid1 清空

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...