Differ GetMessage, PostMessage & PeakMessage?

Answers were Sorted based on User's Feedback



Differ GetMessage, PostMessage & PeakMessage?..

Answer / boggarapu sateesh kumar

GetMessage function waits for a message to be placed in the
queue before returning.

PeekMessage function does not wait for a message to be
placed in the queue before returning.

The PostMessage function places (posts) a message in the
message queue associated with the thread that created the
specified window and then returns without waiting for the
thread to process the message.

Is This Answer Correct ?    16 Yes 3 No

Differ GetMessage, PostMessage & PeakMessage?..

Answer / krishna

GetMessage() will retrives the message from the running
message queue and The function dispatches incoming sent
messages until a posted message is available for retrieval.

PeekMEssage() retrieves the message from running message
queue but will not remove the message information from the
message queue.

PostMessage() Posts the message to the message queue and
returns.

Is This Answer Correct ?    8 Yes 2 No

Differ GetMessage, PostMessage & PeakMessage?..

Answer / sirama

GetMessage() Takes the message from "Message Queue" and
dispatches it to the Window Procedure. And the pointer
moves to the next message in the queue.

PeekMessage() does the same. But, this time, the pointer is
not moved to the next message in the Queue.

PostMessage() : See Krishna's Answer

Is This Answer Correct ?    3 Yes 0 No

Differ GetMessage, PostMessage & PeakMessage?..

Answer / rao naeem

PostMessage is used in Threading usually. to post a message
to Messaging Queue.


Get message is a blocking call it waits for the message
untill it recieve the message it was requiring


Peak message doesnt wait for the message particually it is
looking it just look if the particular message is not in the
queue it returns.

Is This Answer Correct ?    9 Yes 7 No

Post New Answer

More MFC Interview Questions

What are the types of button controls?

10 Answers  


Tell us something about MFC?

7 Answers   Microsoft,


If application hangs while SendMessage is waiting for the result, how you handle it?

2 Answers  


Have you ever used win32 APIs ?

4 Answers   Microsoft,


1)How to change a text of a button as Dynamically?

1 Answers   HCL,






What is the difference between OnInitialUpdate and OnUpdate?

5 Answers  


what if we provide two message handler for same message ?

1 Answers  


Do you have an idea about MFC?

0 Answers   C DAC, CDAC,


What is serialization ?which function is responsible for serializing data ?

5 Answers  


Explain the flow of SDI application?

8 Answers   Mphasis,


Does the application have more than one object? If Yes, Briefly explain.

2 Answers   Soltius Infotech,


What is the base class for most MFC classes?

7 Answers   CMC, Siemens,


Categories