ashish_me2
asked on
Interprocess Messaging in Windows
We are facing a problem in sending messages between two different EXEs on the same machine using WIN API.
The sending EXE uses PostMessage or PostThreadMessage to send a user defined message to the target process. This operation completes successfully, as per the errorcode.
But the target EXE, which uses PeekMessage API to read the message never gets this message.
It would be great if someone could throw some light on what could be the problem or a better way to implement this. We are using Delphi 6.0 to implement this.
Thanks in advance.
The sending EXE uses PostMessage or PostThreadMessage to send a user defined message to the target process. This operation completes successfully, as per the errorcode.
But the target EXE, which uses PeekMessage API to read the message never gets this message.
It would be great if someone could throw some light on what could be the problem or a better way to implement this. We are using Delphi 6.0 to implement this.
Thanks in advance.
If your message code is some WIN_USER+x, I'd suggest using RegisterWindowMessage():
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/registerwindowmessage.asp?frame=true
MS is starting to use some codes above WIN_USER, so custom codes now have to be explicitly registered.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/registerwindowmessage.asp?frame=true
MS is starting to use some codes above WIN_USER, so custom codes now have to be explicitly registered.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Paul