Now if you call the SetHook function from an application there's a beep everytime you press the left mouse button - this continues until you call the UnHookHook
function. In an actual application you're supposed to call CallNextHookEx immediately and do nothing else if code < 0 .