Intercepting Win32 API calls has always been a challenging subject among most of the Windows developers and I have to admit, it's been one of my favorite topics. The term Hooking represents a fundamental technique of getting control over a particular piece of code execution. It provides an straightforward mechanism that can easily alter the operating system's behavior as well as 3rd party products, without having their source code available. Many modern systems draw the attention to their ability to utilize existing Windows applications by employing spying techniques.
Skip to main content. For a Microsoft Visual C version of this article, see This article describes how to set a hook that is specific to a thread and to a hook procedure. This article uses the mouse hook as an example. You can use hooks to monitor certain types of events.
The following procedures show how to hook up an existing method to an event by getting all the necessary types through reflection, and how to create a dynamic method using reflection emit and hook it up to an event. For another way to hook up an event-handling delegate, see the code example for the AddEventHandler method of the EventInfo class. Load an assembly that contains a type that raises events. Assemblies are usually loaded with the Assembly.
Bang a funny guy from Manchester. Billy Moon Edit. Briefly appeared in school.