somnatic
asked on
Sending a Message manually
Well .. again it's me - again another question ;) ..
I have one Application which receives all kinds of messages - especially WM_PAINT and WM_SETFOCUS. Now, from another application I want to send such a message, but I do not want to send WM_PAINT, but well .. something different which does not exist.
On a normal control it shouldn't do anything (so sending WM_SETFOCUS would be completely wrong ;) ) .. only a control which reacts on that message should be affected.
Do I have to do this with a WM_USER Message ? How would I do that ... I'm only interested in the sending Part, I don't care about receiving - cause this already works for WM_PAINT Messages
I have one Application which receives all kinds of messages - especially WM_PAINT and WM_SETFOCUS. Now, from another application I want to send such a message, but I do not want to send WM_PAINT, but well .. something different which does not exist.
On a normal control it shouldn't do anything (so sending WM_SETFOCUS would be completely wrong ;) ) .. only a control which reacts on that message should be affected.
Do I have to do this with a WM_USER Message ? How would I do that ... I'm only interested in the sending Part, I don't care about receiving - cause this already works for WM_PAINT Messages
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SendMessage is synchronous. Function returns only after destination window handles this message. If destination window is not responding, sender is not responding as well.
PostMessage is asynchronous and returns immidiately.
The rule of thumb is using PostMessage whenever it is possible.
PostMessage is asynchronous and returns immidiately.
The rule of thumb is using PostMessage whenever it is possible.
Hi,
Look at here, it may help you...
http://www.thecodeproject.com/csharp/cswindowsmessages.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;812425
http://www.developerfusion.com/show/1713/2/
i hope it may help you..
best of luck..
R.K
Look at here, it may help you...
http://www.thecodeproject.com/csharp/cswindowsmessages.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;812425
http://www.developerfusion.com/show/1713/2/
i hope it may help you..
best of luck..
R.K
ASKER
thanks . .that's what I wanted to hear :)
ASKER
One more question: My solution uses SendMessage (from user32.dll) ..
What is the difference between SendMessage and PostMessage