Link to home
Start Free TrialLog in
Avatar of somnatic
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
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of somnatic
somnatic

ASKER

ha . .found something similar to be working just a few minutes ago ..

One more question: My solution uses SendMessage (from user32.dll) ..

What is the difference between SendMessage and PostMessage
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.
thanks . .that's what I wanted to hear :)