摘要
使用钩子技术,应用程序可以监视指定窗口的某种消息。当截获到消息时,应用程序的钩子函数既可以加工处理该消息,也可以继续传递该消息,还可以强制结束消息的传递,因此,应用程序可以实现普通程序难以实现的功能。本文介绍了钩子的基本概念和类型,还介绍了钩子技术实现的方法,并给出了鼠标和键盘系统钩子的应用示例,为工程人员开发和使用钩子提供了一定的技术支持。
Using hook technique, application program may monitor some messages of specified window. When a certain message is captured, the hook function of application program may process this message, and also may continue to deliver this message, and in addition, it may suspend the message delivery immediately, therefore, the application program may reallize some functions that common program complete difficultly. This paper introduces the conception and types of hook, and introduces the method to realize the hook technique, and also shows an application example of mouse and keyboard system hook, which provides project developer certain technical support of developing and using hook.
出处
《计算机与现代化》
2007年第1期28-30,共3页
Computer and Modernization