SendMessage and PostMessage
-
You can send a standard Windows message or a user defined message using both
SendMessage
andPostMessage
.SendMessage
will wait for the message handler to complete the action, whereasPostMessage
will simply queue the message to the target window's message queue. These APIs can be use to send messages to any window whether in the same process or not.«_Superman_»
I love work. It gives me something to do between weekends. -
PostMessage places a message in the window's message queue and then returns without waiting for the corresponding window to process the message. The SendMessage function calls the window procedure directly and does not return until that window procedure has processed the message.
-- "Programming is an art that fights back!"
-
You can send a standard Windows message or a user defined message using both
SendMessage
andPostMessage
.SendMessage
will wait for the message handler to complete the action, whereasPostMessage
will simply queue the message to the target window's message queue. These APIs can be use to send messages to any window whether in the same process or not.«_Superman_»
I love work. It gives me something to do between weekends. -
There can be many uses. One such use is for simple interprocess communication like sending a
WM_CLOSE
message to an external application. Another frequently used scenario is when you declare your own custom messages likeWM_USER + 1
orWM_APP + 1
.«_Superman_»
I love work. It gives me something to do between weekends. -
There can be many uses. One such use is for simple interprocess communication like sending a
WM_CLOSE
message to an external application. Another frequently used scenario is when you declare your own custom messages likeWM_USER + 1
orWM_APP + 1
.«_Superman_»
I love work. It gives me something to do between weekends.