Click here to Skip to main content
15,927,212 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSendMessage Pin
Anilkumar K V3-Apr-07 20:11
Anilkumar K V3-Apr-07 20:11 
AnswerRe: SendMessage Pin
Naveen3-Apr-07 20:44
Naveen3-Apr-07 20:44 
AnswerRe: SendMessage Pin
prasad_som3-Apr-07 21:10
prasad_som3-Apr-07 21:10 
GeneralRe: SendMessage Pin
Naveen3-Apr-07 21:39
Naveen3-Apr-07 21:39 
AnswerRe: SendMessage Pin
prasad_som4-Apr-07 2:47
prasad_som4-Apr-07 2:47 
AnswerRe: SendMessage Pin
Roger Stoltz3-Apr-07 21:47
Roger Stoltz3-Apr-07 21:47 
GeneralRe: SendMessage Pin
Anilkumar K V3-Apr-07 23:00
Anilkumar K V3-Apr-07 23:00 
GeneralRe: SendMessage Pin
Roger Stoltz4-Apr-07 1:08
Roger Stoltz4-Apr-07 1:08 
What Charles Petzold meant with the statement you've quoted is probably that you seldom call a message handler directly as an ordinary function call.
If you find yourself in a situation where you would like to call a message handler directly, you should call SendMessage() with appropriate message ID as argument. I guess this is what Petzold refers to as being "called from Windows itself" since your using the Win32 API method SendMessage().


anilFirst wrote:
So how the SendMessage and PostMessage invoke window proc's? What is internal working of both?


This addresses the message management routines from a different perspective than the Petzold qoute. The qoute answers a question such as "how do I call a message handler from my code", but I understand your question to be more like "in what ways does a message handler get called when sending a message with SendMessage and PostMessage".

A part of the answer for that question can be read in my previous post and also by following the MSDN link I provided.
In addition: when posting a message with PostMessage(), the message is always placed in the message queue for the receiving window and retrieved with a call to GetMessage(). The matching message handler is then usually determined by a switch-case statement and called with the parameters that came with the message.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

GeneralRe: SendMessage Pin
Anilkumar K V9-Apr-07 23:14
Anilkumar K V9-Apr-07 23:14 
GeneralRe: SendMessage Pin
Roger Stoltz10-Apr-07 1:29
Roger Stoltz10-Apr-07 1:29 
GeneralRe: SendMessage Pin
Anilkumar K V11-Apr-07 19:53
Anilkumar K V11-Apr-07 19:53 
QuestionTab controls Pin
deeps_cute3-Apr-07 20:04
deeps_cute3-Apr-07 20:04 
AnswerRe: Tab controls Pin
vimarsh puneet3-Apr-07 20:31
vimarsh puneet3-Apr-07 20:31 
AnswerRe: Tab controls Pin
Cedric Moonen3-Apr-07 20:56
Cedric Moonen3-Apr-07 20:56 
QuestionMake virtual method in my project Pin
nhatvhm3-Apr-07 18:34
nhatvhm3-Apr-07 18:34 
GeneralRe: Make virtual method in my project Pin
prasad_som3-Apr-07 18:48
prasad_som3-Apr-07 18:48 
AnswerRe: Make virtual method in my project Pin
ThatsAlok18-Apr-07 21:08
ThatsAlok18-Apr-07 21:08 
QuestionHow to use form view in tab control Pin
sireesha_sree3-Apr-07 18:29
sireesha_sree3-Apr-07 18:29 
AnswerRe: How to use form view in tab control Pin
Naveen3-Apr-07 19:14
Naveen3-Apr-07 19:14 
GeneralRe: How to use form view in tab control Pin
sireesha_sree3-Apr-07 19:22
sireesha_sree3-Apr-07 19:22 
QuestionRe: How to use form view in tab control Pin
vimarsh puneet3-Apr-07 19:26
vimarsh puneet3-Apr-07 19:26 
AnswerRe: How to use form view in tab control Pin
sireesha_sree3-Apr-07 19:49
sireesha_sree3-Apr-07 19:49 
GeneralRe: How to use form view in tab control Pin
vimarsh puneet3-Apr-07 20:02
vimarsh puneet3-Apr-07 20:02 
GeneralRe: How to use form view in tab control Pin
Naveen3-Apr-07 19:47
Naveen3-Apr-07 19:47 
GeneralRe: How to use form view in tab control Pin
megha_gharote3-Apr-07 19:52
megha_gharote3-Apr-07 19:52 

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.