Microsoft KB Archive/36584

From BetaArchive Wiki

PRB: When PostMessage() Returns 0, Indicating Failure


The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) versions 3.1, 3.0


PostMessage(hWnd,wMsg,wParam,lParam) returns 0, indicating failure.


PostMessage(hWnd,wMsg,wParam,lParam) returns 0, indicating failure, for one of the following two reasons:

  • The window handle (hWnd parameter to PostMessage()) receiving the message is -1. If this is the case, the message (wMsg) is broadcast to all windows.
  • The window to receive the message has a full application queue.

Note that PostMessage() does not return NULL if the hWnd parameter in the PostMessage() call is an invalid window handle. Also note that IsWindow() can be called to verify whether a given handle is indeed a valid window handle.

Additional query words:

Keywords : kb16bitonly kbSDKPlatform kbGrpDSUser kbWndw kbWndwMsg
Issue type : kbprb
Technology : kbAudDeveloper kbWin3xSearch kbSDKSearch kbWinSDKSearch kbWinSDK300 kbWinSDK310

Last Reviewed: November 6, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.