Windows 消息的问题,A.exe向B.exe 通过消息把文件路径(sFileName)发送给B.exe,b接收到文件名后,计算出文件大小,再通过消息传回A

D

driayu

Unregistered / Unconfirmed
GUEST, unregistred user!
Windows 消息的问题,A.exe向B.exe 通过消息把文件路径(sFileName)发送给B.exe,b接收到文件名后,计算出文件大小,再通过消息传回A.exe(50)<br />请问,谁能帮我完成这个代码.谢谢!
 
进程之间发送字符串 procedure PostStrToOther(H: HWND; OtherStr: string); var DS: TCopyDataStruct; begin ShowMessage('发送:' + OtherStr); Ds.cbData := Length(OtherStr) + 1; //或者是结构体长度 sizeof(结构体变量) GetMem(Ds.lpData, Ds.cbData); StrCopy(ds.lpData, PChar(OtherStr)); SendMessage(H, WM_COPYDATA, Application.Handle, Cardinal(@ds)); FreeMem(Ds.lpData); end; procedure TFrmOther.MyMessage(var t: TWMCopyData); //Message WM_COPYDATA; var tmpStr:String; begin //接受消息并显示。 tmpStr:=StrPas(t.CopyDataStruct^.lpData); Memo1.Lines.Add(tmpStr); end;=========发送文件大小,方法也差不多。
 
有被 抢分专业户 回了
 
有一个进程间通信的空间,可以试验用一下,名字好像是ZY????的,搜一下看看。
 
ZylAppCommunicator 1.11 ZylAppCommunicator 1.11 for Delphi & C++Builder 6-2009 Crackedhttp://www.zylsoft.com/appcomm.htmZylAppCommunicator is a Delphi & C++Builder component which allows you to communicate between one or more applications which are running on the same computer.Use ZylAppCommunicator if you want to easily communicate between your applications.Code:http://www.disperseit.com/view.php?id=26185Pass:Code:DarkRapt0r@board4all// DarkRapt0r
 
InterAppCommTwo components, a sender and a receiver, which can communicate between separate applications on the same machine. The communication occurs conveniently through the use of events. Demos included.download:http://subsimple.com/delphi.asp
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
I
回复
0
查看
567
import
I
顶部