Got bored of doing revision and started on a HookLib, this is an example program where I was testing using a CBT Hook.
header.h
Main.cpp
CBTHook.cpp
Its just a quick throw-together of setting a cbt hook on your window, the HookLib exports the hook function, allowing you to hook any process/the entire system.
Also note that the IsBadReadPtr is just there to ensure that the structure returned by the hook is valid, as sometimes it isnt causing the function to die.