title: C++ MessageBox (Windows.h) - What does it do an how can I make it invisible (or equivalent)?
body: <p>When I have:</p>
  
  <pre><code>MessageBox(NULL, NULL , "MessageBox", NULL);
  </code></pre>
  
  <p>A message box comes up and my program works as I desire it to until the user clicks okay on the message box and then the program ends. I tried to put an infinite loop in to have the same effect, but this doesn't work in the same way as the message box does. The reason I don't want the message box is the fact that it obstructs the user's view of the program and if they try to close it then the program stops. So I basically just want to have an invisible message box or something with the same effect.</p>
  
  <p>EDIT: To clarify, the program is a prototype for a game. I am using hooks to find what keys the user is pressing. Here is a simplified version of the program: </p>
  
  <pre><code>#define WM_KEYDOWN                      0x0100
  #define _WIN32_WINNT 0x0500
  
  #include &lt;iostream&gt;
  #include &lt;windows.h&gt;
  #include &lt;winuser.h&gt;
  
  using namespace std;
  
  LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam){
  
  
  PKBDLLHOOKSTRUCT keypointer = (PKBDLLHOOKSTRUCT)(lParam);
  if (wParam==WM_KEYDOWN){
  
      switch(keypointer-&gt;vkCode){
  
  
          case VK_RIGHT:
              cout &lt;&lt; "**RIGHT**";
              goto skip;
          case VK_LEFT:
              cout &lt;&lt; "**LEFT**";
              goto skip;
          case VK_DOWN:
              cout &lt;&lt; "**DOWN**";
              goto skip;
          case VK_UP: 
              cout &lt;&lt; "**UP**";
          skip:
          default:
              cout &lt;&lt; "";
      }
  }
  return CallNextHookEx(NULL, nCode, wParam, lParam);
  }
  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
  
  
  SetWindowsHookEx(WH_KEYBOARD_LL, HookProc, hInstance, 0);
  
  MessageBox(NULL, NULL , "KLMBOX", NULL);
  
  return 0;
  
  }
  </code></pre>
  
  <p>I just want the program to have the same functionality, but without displaying a message box! I'm not an expert I was just messing around with: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632589(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ms632589(v=vs.85).aspx</a></p>