Discussion:
Returning Windows Messages
(too old to reply)
d***@mac.com
2006-11-16 15:38:51 UTC
Permalink
Raw Message
I have two applications that I want to talk to each othe

Application 1 uses the following code to send some information to
Application 2 and lock up until it gets an appropriate reply:


MF.Enabled := False; // Deactivate the main form
sent := SendMessage(rh, WM_COPYDATA, Integer(Handle),
Integer(@copyDataStruct));
if sent > 0 then // reactivate the main form when
edits are over

Application 2 catches the message using the following code:

procedure TEditProjectDetails.WMCopyData(var msg: TWMCopyData);
begin
HandleReceivedMessage(Msg.CopyDataStruct);
// Only want to return result if
Msg.Result := 1;
end;

The HandleReceivedMessage procedure uses the received information to
seed a form which is then edited and saved.

Whilst I can seed the form what I cannot figure out is how to wait
until the data is saved to send the Msg.Result back to Application 1.
Copying Msg into a global variable seems not to work when I assign to
Msg.Result at a later point...
Riki Wiki
2006-11-22 06:46:24 UTC
Permalink
Raw Message
Hoi

You need to repost your question in newsgroup b.p.d.nativeapi.win32 because
this newsgroup do not officially exist.

How to post to Delphi newsgroups:
<http://delphi.wikia.com/wiki/Delphi_Newsgroups>

Loading...