A question:
why are you passing NULL to CallNextHookEx? The first parameter should be the handle returned from a call to SetWindowsHookEx.

Also, try removing the call to MessageBox and using a different way to notify show window text.