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 得到一个cuid用户唯一标识

Delphi中如何捕获mediaplayer播放的视频中的每一帧 ?

Delphi获取盘符代码

Delphi 内存中加载dll

了解Delphi过程类型/过程类型学习

Delphi strutils.dupestring - 反复字符串

Delphi 实现卸载windows应用程序(类似360软件管家-卸载程序)

Delphi中强制idhttp使用http1.1

Delphi 时间到就触发事件

Delphi调用游戏call代码

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



打赏

取消

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

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

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

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

评论

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