The information in this article applies to:
SYMPTOMSIn Windows version 3.1, the SetWindowsHookEx() function fails when it is called to install a task-specific filter (hook) that resides in a DLL. CAUSE
According to the documentation, the third parameter to the
SetWindowsHookEx() function must be the instance handle of the
application or the DLL that contains the filter function. However,
because of a problem in Windows 3.1, the SetWindowsHookEx() function
fails when it is called to install a task-specific filter using the
DLL's instance handle.
RESOLUTIONTo install a task-specific filter that resides in a DLL, pass the module handle of the DLL as the third parameter to the SetWindowsHookEx() function. The module handle can be retrieved using the GetModuleHandle() function. For example, to install a task-specific keyboard filter, the code might resemble the following:
This resolution is compatible with future versions of Windows.
Additional query words: hook not allowed
Keywords : kbcode kb16bitonly kbHook kbGrpUser kbWinOS310 |
Last Reviewed: January 10, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |