钩子技术(六)
来源: 任立波的日志
方法5
:
CBTProc Function
The CBTProc hook procedure is an application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function before activating, creating, destroying, minimizing, maximizing, moving, or sizing a window; before completing a system command; before removing a mouse or keyboard event from the system message queue; before setting the keyboard focus; or before synchronizing with the system message queue. A computer-based training (CBT) application uses this hook procedure to receive useful notifications from the system.
CBTProc钩子子程是和SetWindowsHookEx方法同时使用的、程序定义的或者库定义的回调函数。系统在下列事件发生之前调用该方法:
<!--[if !supportLists]-->1.
<!--[endif]-->激活、创建、销毁、最小化、最大化、移动窗体、改变窗体大小;
<!--[if !supportLists]-->2.
<!--[endif]-->完成系统命令;
<!--[if !supportLists]-->3.
<!--[endif]-->从系统消息队列中移除鼠标或者键盘事件;
<!--[if !supportLists]-->4.
<!--[endif]-->设置键盘焦点;