Windows Userland Hooks
From Ggl's wiki
Hooking with SetWindowsHookEx()
Good tutorial from MSDN: Using Hooks.
Basically to install a hook with SetWindowsHookEx():
HOOKPROC hkprcSysMsg; static HINSTANCE hinstDLL; static HHOOK hhookSysMsg; hinstDLL = LoadLibrary((LPCTSTR) "c:\\code\\hooks\myhook.dll"); hkprcSysMsg = (HOOKPROC)GetProcAddress(hinstDLL, "SysMessageProc"); hhookSysMsg = SetWindowsHookEx(WH_SYSMSGFILTER,hkprcSysMsg,hinstDLL,0);

