What is the difference between GetMessage and PeekMessage ?

Answers were Sorted based on User's Feedback



What is the difference between GetMessage and PeekMessage ? ..

Answer / girish tryambake

The major difference between the two is that GetMessage()
doesn't return until it finds a message to retrieve from the
Application Queue, this allows us to free up precious CPU
usage for other programs to use. PeekMessage() returns
immediately weather there are any messages or not, this
allows us to utilize the time between messages, for example
to render a 3D scene.

Is This Answer Correct ?    29 Yes 4 No

What is the difference between GetMessage and PeekMessage ? ..

Answer / sandeep

GetMessage essentially waits for any message to be placed in
the queue
before it returns. On other hadn, PeekMessage function does
not wait.
That means GetMessage can block until the message appears in
the queue.

Is This Answer Correct ?    21 Yes 1 No

What is the difference between GetMessage and PeekMessage ? ..

Answer / amol lande

GetMessage:
a. It retrieves the message from the calling thread's message queue.
b. It blocks until it gets a message or an error occurs.
c. It can filter message as per specified filter.
PeekMessage:
a. It checks for the message in the calling thread's message queue and it retrieves the message if any present.
b. As specified in the argument, it may or may not removes the message from message queue.
c. It returns immediately if there is no message found in the message queue.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More MFC Interview Questions

How do you change the properties for a tree view control that is part of the CTreeView class?

1 Answers  


What is the command routing in MFC framework?

3 Answers  


plzz tell me what we can do and dont in tally ERP & sap business one?

0 Answers  


Can you explaing the relashionship between document,frame and view ?

2 Answers  


Have you ever used win32 APIs ?

4 Answers   Microsoft,






What is the initial function to be called in MFC and what it will do

11 Answers   Infosys,


What is primitive and non-primitive application?

2 Answers   HCL,


What view class enables you to use an edit control as a view?

1 Answers  


how do u identify RTTI in vc++

4 Answers   Siemens,


What is the difference between regular dlls and extended dlls?

2 Answers  


what are the feauters of CObject

4 Answers   Siemens, Wipro,


How we call a dialog in another dialog?

2 Answers  


Categories