The development of the Windows applications has many features, which can have an interesting effect, if handled efficiently. The Windows API provides an opportunity to use hooks for the implementation of specific application features. The Hook, in the context of the Windows operation system, is a mechanism of messages, capturing before they are received by the application. In this way, some functions can be attached to the hook and it can handle it before the control is passed to the main application functions. As a result, the system can approve or cancel the user's action.
Functions, which are used for the messages' hooking, are the filtering functions. There are some different hooks, depending on the input device. The most popular hooks are for the keyboard and mouse. Attaching a function to a certain hook is a hook set up process. If the hook has some functions attached, then the hooking queue processes the messages. This queue works according to the principle "first in - first out". The Windows applications can use the hooking functionality for the next purposes:
-Handling or changing dialog box messages.
-Handling any system messages, received by application.
-Record keyboard's or mouse's events and many others.
There are different scopes for the hooks. The thread and system hooks are used more often. The usage of the thread hooks is preferable for the following reasons:
-They do not create an additional loading for applications;
-They do not place all the hook related messages to queue;
-They do not require placing needed functions in one DLL file.
System hooks require the usage of the one common DLL:
-They do not need to separate the data between DLL libraries, loaded to the different processes. A programmer should use some common statements for the hook implementation. Such facts must be of great importance:
-How should the filtering functions from the hook add or delete the Windows functions;
-What actions should the filtering function, which you set up, perform;
-Which are the types of the hooks, what operations they can perform and which information is handled by them?
Windows organizes the queue of the filtering functions in the hooks. The operation system does not rely the saving of the functions' addresses to other functions, as the earlier releases of Windows included them. In this way, the developers of the later Windows versions clarified significantly the hooks system. This implementation has improved the performance of the system. The hooks' usage provides many interesting opportunities for Windows developers. Any programming language supports the usage of the hooks. With further development of the Windows system API, more interesting opportunities will be accessible for the applications developers in the Windows environment. The multiple Windows developers will appreciate the hooks technology. There are many interesting applications of features that can be performed with the help of the programming interface of the Windows operation system.