title: How do I use SetWindowsHookEx to filter low-level key events?
body: <p>I have this code which sets up a keyboard hook for low-level events, then displays a message box.</p>
  
  <pre><code>HHOOK keyboardHook = SetWindowsHookEx (WH_KEYBOARD_LL, HookKey, hInstance, 0);
  
  MessageBox(NULL, L"Click to exit", L"hook test", NULL);
  
  UnhookWindowsHookEx(keyboardHook);
  </code></pre>
  
  <p>How do I run the application's main loop without creating a foreground window, and how do I set <code>hInstance</code> to capture global events?</p>