Click here to Skip to main content
15,913,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Windbg Pin
Mike Dimmick8-Jul-07 11:51
Mike Dimmick8-Jul-07 11:51 
QuestionPostMessage Pin
tom groezer7-Jul-07 23:06
tom groezer7-Jul-07 23:06 
AnswerRe: PostMessage Pin
mid=57418-Jul-07 0:13
mid=57418-Jul-07 0:13 
AnswerRe: PostMessage Pin
Bogdan Apostol8-Jul-07 0:38
Bogdan Apostol8-Jul-07 0:38 
GeneralRe: PostMessage Pin
tom groezer8-Jul-07 4:54
tom groezer8-Jul-07 4:54 
GeneralRe: PostMessage Pin
mid=57419-Jul-07 5:30
mid=57419-Jul-07 5:30 
QuestionRe: PostMessage Pin
jbalaji849-Aug-07 21:18
jbalaji849-Aug-07 21:18 
AnswerRe: PostMessage Pin
Randor 8-Jul-07 6:57
professional Randor 8-Jul-07 6:57 
tom groezer wrote:
MSDN states that sending a message is done directly to a message windows procedure rather than message queue.


Hi again,

It seems others tend to paste MSDN snippets, however I'll try to explain it as I understand it. Lets just hope that I understand it correctly Smile | :)

Its quite complicated... and this is only a summary.

SendMessage() ... It will completely bypass the message que and ultimately call the window Proc directly. The message is never placed into the message que. Instead it is placed into a seperate FIFO stack of "nonqueued messages" which is technically not the normal message que.

The following functions generate nonqueued messages:
SendMessage, SendMessageCallback, SendMessageTimeout, SendNotifyMessage, BroadcastSystemMessage, BroadcastSystemMessageEx... maybe more I dunno.

PostMessage()... always places the message into the standard windows message que and returns immediately.

tom groezer wrote:
If that is true then is it true that GetMessage/PeekMessage is valid only for messages that are placed into message queue by postmessage.

GetMessage() and PeekMessage() checks for both queued and nonqueued messages. Meaning regardless of whether they are sent by SendMessage() or PostMessage() you can filter them.

tom groezer wrote:
Also if we want to direct a message to another process will both PostMessage/SendMessage work. What is the difference?


You should use PostMessage(). If you use SendMessage() and the other application is blocked... your SendMessage() will never return. But there are alternatives... SendMessageTimeout() and such.

Best Wishes,
-Randor (David Delaune)
GeneralRe: PostMessage Pin
Bogdan Apostol8-Jul-07 8:59
Bogdan Apostol8-Jul-07 8:59 
GeneralRe: PostMessage Pin
Randor 8-Jul-07 9:06
professional Randor 8-Jul-07 9:06 
AnswerRe: PostMessage Pin
Bogdan Apostol8-Jul-07 10:43
Bogdan Apostol8-Jul-07 10:43 
QuestionGet exact memory usage of a process. Pin
zecodela7-Jul-07 23:03
zecodela7-Jul-07 23:03 
AnswerRe: Get exact memory usage of a process. Pin
Bogdan Apostol8-Jul-07 1:09
Bogdan Apostol8-Jul-07 1:09 
QuestionWM_COPYDATA message Pin
tom groezer7-Jul-07 22:35
tom groezer7-Jul-07 22:35 
AnswerRe: WM_COPYDATA message Pin
Bogdan Apostol8-Jul-07 1:20
Bogdan Apostol8-Jul-07 1:20 
GeneralRe: WM_COPYDATA message Pin
tom groezer8-Jul-07 5:08
tom groezer8-Jul-07 5:08 
GeneralRe: WM_COPYDATA message Pin
Randor 8-Jul-07 5:50
professional Randor 8-Jul-07 5:50 
GeneralRe: WM_COPYDATA message Pin
Bogdan Apostol8-Jul-07 8:35
Bogdan Apostol8-Jul-07 8:35 
Questionnew control icon into vc++ toobox Pin
eagle517-Jul-07 22:22
eagle517-Jul-07 22:22 
AnswerRe: new control icon into vc++ toobox Pin
David Crow9-Jul-07 3:44
David Crow9-Jul-07 3:44 
GeneralRe: new control icon into vc++ toobox Pin
eagle5110-Jul-07 23:06
eagle5110-Jul-07 23:06 
GeneralRe: new control icon into vc++ toobox Pin
David Crow11-Jul-07 2:29
David Crow11-Jul-07 2:29 
QuestionHyperTerminal script Pin
stevelizardi7-Jul-07 20:18
stevelizardi7-Jul-07 20:18 
QuestionInterprocess commmunication Pin
tom groezer7-Jul-07 11:41
tom groezer7-Jul-07 11:41 
AnswerRe: Interprocess commmunication Pin
Mark Salsbery7-Jul-07 12:10
Mark Salsbery7-Jul-07 12:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.