Windows Hook Message Classification

Source: Internet
Author: User

The module instance handle of the DLL that calls SetWindowsHookEx, which can be obtained through the first parameter of the DllMain entry.
Hhook SetWindowsHookEx (int idhook,
HOOKPROC LPFN,
HInstance Hmod,
DWORD dwThreadID);
As for SetWindowsHookEx's fourth parameter, dwThreadID, is the window thread ID you need to get from the window handle.
You can get it by using the following code:
DWORD dwThreadID = GetWindowThreadProcessId (hwnd, NULL);
Select the appropriate message hooks, such as
wh_callwndproc//monitoring the message before the window arrives
wh_callwndprocret//monitoring window after processing the message
wh_debug//monitoring system calls other hooks associated with the hook thread
wh_getmessage//monitoring messages sent to the form message queue
wh_journalplayback//Global hook, can insert message to message queue
wh_journalrecord//Global hook, monitor input events (keyboard, mouse, etc.)
wh_keyboard//Keyboard Hooks
wh_mouse//Mouse Hooks
wh_msgfilter//Monitor menu, scroll bar, message box, dialog box message, and Toggle window key combinations (ALT + TAB, etc.)
wh_shell//important notifications in the receiving system (e.g., Windows being generated, destroyed, etc.)

http://blog.csdn.net/y281252548/article/details/51810260

Windows Hook Message Classification

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.