any more ideas?
Assuming that's the entirety of the DLL minus includes then posting your real code would be a good start In it's current state MouseProc uses the undefined _lParam and _wParam variables, that's not a cause for the CBT failure but who knows what else is in your real code that's not here and vice versa. If they've just been left out of the listing, you might want to update them somewhere or the mousehook will always have the same behaviour, renaming them would also be a good idea.