title: SetWindowsHookEx freeze my keyboard and mouse, and other strange things happends
body: <p>I'm writing joke program (makes strange sounds, where user use mouse or keyboard) in Delphi, which uses global hooks to capture mouse and keyboard events.<br> 
  This is function responsible for handle this hook:<br></p>
  
  <pre><code>procedure MKHOOK(code: Integer;wp: wParam;lp: lParam); stdcall;
  var
  hh: HHOOK;
  begin
    PlaySound('fart.wav');
    CallNextHookEx(hh,code,wp,lp);
  end;
  </code></pre>
  
  <p>Hook starts, when Form is creating:</p>
  
  <pre><code>procedure TForm6.FormCreate(Sender: TObject);
  begin
     MH := SetWindowsHookEx(WH_MOUSE_LL,@MKHOOK,hInstance,0);
     KH := SetWindowsHookEx(WH_KEYBOARD_LL,@MKHOOK,hInstance,0);
  end;
  </code></pre>
  
  <p>Where MH and KH are type of HHOOK<br>
  Hook is deleted, when program ends:</p>
  
  <pre><code>procedure TForm6.FormDestroy(Sender: TObject);
  begin
     UnhookWindowsHookEx(MH);
     UnhookWindowsHookEx(KH);
  end;
  </code></pre>
  
  <p>Problems starts, when I try to run it there are strange things happends like:</p>
  
  <ul>
  <li>Mouse and keyboard stopped working, I must use ctrl + alt + del to recover it</li>
  <li>Some keys didn't working after program execution, when I stoped it (ctrl, alt, tab)</li>
  <li>Some keys change their behavior for example, when I used arrows keys, they turn my screen view.</li>
  </ul>
  
  <p>What is wrong with this code? Why it not works?  Sorry for my English ;)</p>