HHOOK SetWindowsHookEx( int idHook , // hook type --------------------WH_KEYBOARD HOOKPROC lpfn , // hook procedure 安装的回调函数 HINSTANCE hMod , // handle to application instance DLL句柄 DWORD dwThreadId // thread identifier 线程ID );
LRESULT CALLBACK KeyboardProc( 回调函数 int code , // hook code WPARAM wParam , // virtual-key code 实际按键代码 LPARAM lParam // keystroke-message information );
LRESULT CallNextHookEx( HHOOK hhk , // handle to current hook 键盘安装钩子句柄 int nCode , // hook code passed to hook procedure WPARAM wParam , // value passed to hook procedure LPARAM lParam // value passed to hook procedure );