[comp.windows.ms.programmer] PostMessage vs. SendMessage

F0O@psuvm.psu.edu (06/27/91)

   I'm very new to windows programming, and was wondering for what sorts
or reasons would you want to use one over the other?
   PostMessage will put it's message in the queue and return immediately,
where SendMessage doesn't put it's message in the queue but waits until
the message is processed before returning.
   It looks to me like PostMessage would be better to use, since you
wouldn't have to wait for the message to be processed; unless you don't
want to fill the queue up with an additional message.

                                                              [Tim]

coates@UC780.UMD.EDU (06/28/91)

In article <91178.090744F0O@psuvm.psu.edu>, F0O@psuvm.psu.edu writes:
>
>   I'm very new to windows programming, and was wondering for what sorts
>or reasons would you want to use one over the other?
>   PostMessage will put it's message in the queue and return immediately,
>where SendMessage doesn't put it's message in the queue but waits until
>the message is processed before returning.
>   It looks to me like PostMessage would be better to use, since you
>wouldn't have to wait for the message to be processed; unless you don't
>want to fill the queue up with an additional message.
>
>                                                              [Tim]


I amy not need to say this but it seems that if you want the message acted on
immediately you would send a SendMessage whereas if you can wait doa
PostMessage. SendMessage sends a message immediately to the winproc whose
handle is in its parameter list.

cadsi@ccad.uiowa.edu (CADSI) (06/28/91)

From article <91178.090744F0O@psuvm.psu.edu>, by F0O@psuvm.psu.edu:
> 
>    I'm very new to windows programming, and was wondering for what sorts
> or reasons would you want to use one over the other?
>    PostMessage will put it's message in the queue and return immediately,
> where SendMessage doesn't put it's message in the queue but waits until
> the message is processed before returning.
>    It looks to me like PostMessage would be better to use, since you
> wouldn't have to wait for the message to be processed; unless you don't
> want to fill the queue up with an additional message.
> 

Many Message calls return a piece of information needed to carry forward.
In these cases, the SendMessage is needed for the return value.

|----------------------------------------------------------------------------|
|Tom Hite					|  The views expressed by me |
|Manager, Product development			|  are mine, not necessarily |
|CADSI (Computer Aided Design Software Inc.	|  the views of CADSI.       |
|----------------------------------------------------------------------------|