-
进程跟子进程通讯demo带源码 (1).zip下载
资源介绍
//d2010之前
procedure TmainForm.SendProcessMsg(mainHandle:THandle;wIdent:Word;sSendMsg:String);
//D2010之后
function TmainForm.SendMessageToProcess(hwndSend:HWND;wIdent:word;s:string):boolean;
procedure TmainForm.MyMessage(var MsgData: TWmCopyData);
var
wIdent:Word;
lvSize:Cardinal;
lvMsg:String;
begin
wIdent:=HiWord(MsgData.From);
lvMsg:=StrPas(pchar(MsgData.CopyDataStruct^.lpData));
lvSize:=MsgData.CopyDataStruct^.cbData;
case wIdent of
1000:
begin
Edit1.Text:= lvMsg;
Memo1.Lines.Add('收到登录成功消息:'+lvMsg +',Length='+ IntToStr(lvSize));
end;
1001:
begin
Memo1.Lines.Add('收到发送消息:'+ lvMsg+',Length='+ IntToStr(lvSize));
end;
end;
end;
end.