HHOOK SetWindowsHookEx(
int idHook, // type of hook to install
HOOKPROC lpfn, // address of hook procedure
HINSTANCE hMod, // handle to application instance
DWORD dwThreadId // identity of thread to install hook for
);
这个API就是用来注入钩子的啦...
Win32 Hooks
Kyle Marsh
Microsoft Developer Network Technology Group
Created: July 29, 1993
Revised: February 1994
Added exception for journal hooks in "Filter functions in DLLs" section.
Added .EXE file to where filters can reside in "WH_JOURNALRECORD" and "WH_JOURNALPLAYBACK" sections.
Changed HIWORD and LOWORD to HIBYTE and LOBYTE in "HC_ACTION" section.
Click to open or copy the files in the Hooks sample application.
Abstract
This article describes hooks and their use in the Microsoft® Win32™ application programming interface (API). It discusses hook functions, filter functions, and the following types of hooks:
WH_CALLWNDPROC
WH_CBT
WH_DEBUG
WH_FOREGROUNDIDLE
WH_GETMESSAGE
WH_JOURNALPLAYBACK
WH_JOURNALRECORD
WH_KEYBOARD
WH_MOUSE
WH_MSGFILTER
WH_SHELL
WH_SYSMSGFILTER
Terminology In this article, the term Windows refers to the Windows family of operating systems, that is, 16-bit Windows, Windows NT™, and Windows for Workgroups. Likewise, Windows 3.1 refers to the 3.1 version of these operating systems.