DOCERR: Determining Message Removal from WH_GETMESSAGE HookLast reviewed: July 23, 1997Article ID: Q104068 |
3.00 3.10
WINDOWS
kbprg kbdocerr
The information in this article applies to:
A WH_GETMESSAGE hook is called each time PeekMessage or GetMessage is called. The wParam parameter of the hook indicates whether the message is being removed from the queue or merely being looked at. If PeekMessage is called with the PM_NOREMOVE flag, the message will not be removed from the queue. A WH_GETMESSAGE hook is called each time PeekMessage or GetMessage is called, and therefore the hook may be called more than once for the same message if PeekMessage is called with PM_NOREMOVE. The hook can determine whether the message is being removed by using the information in the wParam parameter. wParam contains the PM_* flags that were used in the PeekMessage call. GetMessage calls PeekMessage with the PM_REMOVE flag. The Windows 3.1 SDK does not document the value of wParam. It will be documented in future versions. Note that PM_NOREMOVE is defined as 0x0000, and therefore must be used carefully in any Boolean conditional code. Code similar to the following may be used in the hook:
if (wParam & PM_REMOVE) Message is being removed; else Message is being looked at but not being removed. The hook may be called again for the same message. |
Additional reference words: 3.00 3.10 multiple
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |