To install a filter function, an application must do the following:
1.Export the function in its module-definition (.DEF) file.
2.Obtain the function's address by using the GetProcAddress function. (The MakeProcInstance function is used only when the filter function is not in a DLL.)
3.Call the SetWindowsHook function, specifying the type of hook function and the address of the function (returned by GetProcAddress).
4.Store the return value from SetWindowsHook in a reserved location. This value is the handle of the previous filter function.
Note:
Filter functions must reside in fixed library code and data. This allows hooks to operate in a large-frame Expanded Memory Specification (EMS) environment.