MousHook.exe Demonstrates Windows 3.1 WH_MOUSE Hook

ID: Q81333


The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) 3.1


SUMMARY

MousHook.exe is a sample that demonstrates how to install and use a WH_MOUSE mouse message hook. The mouse message hook in MousHook.exe disables the right mouse button for all applications in the system by discarding WM_RBUTTONDOWN and WM_NCRBUTTONDOWN messages. The mouse hook function beeps each time it discards a message.

MousHook.exe contains the source to an application program, TESTAPP, and a dynamic-link library (DLL), MousHook.dll, that implements the mouse hook. The MousHook.dll uses the new hook functions provided by Windows 3.1: SetWindowsHookEx(), UnhookWindowsHookEx(), and CallNextHookEx().

TESTAPP calls MOUSHOOK to install the mouse hook. When TESTAPP is closed, it removes the mouse hook from the system.


MORE INFORMATION

The following files are available for download from the Microsoft Download Center. Click the file names below to download the files:


MousHook.exe

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address

http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

Additional query words:

Keywords : kbfile kbsample kb16bitonly kbHook kbGrpUser kbWinOS310
Version : WINDOWS:3.1
Platform : WINDOWS
Issue type :


Last Reviewed: December 7, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.