title: Multithreading with _beginthread and CreateThread
body: <p>I try to write a Multithreading WIN32 Application in C++, but due to i get difficulties. 
  One of the Window Procedure creates a Thread, which manages the output of this window. If this Window Procedure receives a message (from the other Window Procedures), it should transmit it to their Thread. At the beginning i worked with the _beginthread(...) function, what doesn't work. 
  Then i tried it with the CreateThread(...) function, and it worked? What did i do wrong?
  (My English isn't so good, i hope you understand my problem)</p>
  
  <p>Code with CreateThread(...):</p>
  
  <pre><code>DWORD thHalloHandle; // global
  HWND  hwndHallo;     // Hwnd of WndProc4
  ...
  LRESULT APIENTRY WndProc4 (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
  {
   static PARAMS params ;
  
   switch (message)
   {
      case WM_CREATE: {
          params.hwnd = hwnd ;
          params.cyChar = HIWORD (GetDialogBaseUnits ()) ;
          CreateThread(NULL, 0, thHallo, &amp;params, 0, &amp;thHalloHandle);
          return 0 ;
      }
  ...
      case WM_SPACE: {
          PostThreadMessage(thHalloHandle, WM_SPACE, 0, 0);
          return 0;
      }
  ...
  }
  </code></pre>
  
  <p>Code with _beginthread(...):</p>
  
  <pre><code>...
  case WM_CREATE: {
     params.hwnd = hwnd ;
     params.cyChar = HIWORD (GetDialogBaseUnits ()) ;
     thHalloHandle = (DWORD)_beginthread (thHallo, 0, &amp;params) ;
     return 0;
  }
  ...
  case WM_SPACE: {
     PostThreadMessage(thHalloHandle, WM_SPACE, 0, 0);
     return 0;
  }
  ...
  </code></pre>
  
  <p>thHallo for CreateThread:</p>
  
  <pre><code>DWORD WINAPI thHallo(void *pvoid)
  {
      static TCHAR *szMessage[] = { TEXT(...), ...};
      // Some Declaration
      pparams = (PPARAMS) pvoid;
      while(!pparams-&gt;bKill)
      {
        MsgReturn = GetMessage(&amp;msg, NULL, 0, 0);
        hdc = GetDC(pparams-&gt;hwnd);
        if(MsgReturn)
        {
            switch(msg.message)
            {
               // case....
            }
        }
      }
      return 0;
  }
  </code></pre>
  
  <p>thHallo for _beginthread(...):</p>
  
  <pre><code>void thHallo(void *pvoid)
  {
     ...
     // The Same like for CreateThread
     ...
     _endthread();
  }
  </code></pre>