title: CreateWindow return null error
body: <p>I am developing an application using the win32 api, but I have a problem. I wrote code to create a simple window and then create simple button attached to this window and finally create simple menu resource and set it to the window:</p>
  
  <pre><code>#include&lt;Windows.h&gt;
  #include"resource.h"
  
  
  #define DEFAULT_BUTTON_WIDTH 100
  #define DEFAULT_BUTTON_HEIGHT 20
  
  HMENU Menu;
  HWND Window;
  HWND bCreateWall;
  
  void WMCommand(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
  {
      if (lParam == (LPARAM)bCreateWall) MessageBox (Window, (LPCWSTR)"You Pressed bCreateWall", (LPCWSTR)"Congrats!", MB_OK);
      else if (wParam == ID_FILE_EXIT) PostQuitMessage(0);
  }
  
  LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam){
      switch(msg){
      case WM_DESTROY:PostQuitMessage(0);break;
      case WM_COMMAND: WMCommand (hWnd, msg, wParam, lParam); break;
      }
      return (DefWindowProc(hWnd,msg,wParam,lParam));
  }
  
  
  int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevious, LPSTR lpCmdString,int CmdShow)
  {
      WNDCLASS wc;
      MSG msg;
      wc.cbClsExtra = 0;
      wc.cbWndExtra = 0;
      wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
      wc.hCursor = LoadCursor (NULL, IDC_ARROW);
      wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
      wc.hInstance = hInstance;
      wc.lpfnWndProc = WndProc;
      wc.lpszClassName = (LPCWSTR)"ME";
      wc.lpszMenuName = NULL;
      wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
  
      if (!RegisterClass(&amp;wc))
      {
          MessageBox (NULL,(LPCWSTR)"Error: Cannot Register Class", (LPCWSTR)"ERROR!", MB_OK);
          return (0);
      }
  
      //create window
      Window = CreateWindow((LPCWSTR)"ME",(LPCWSTR) "Map Editor", WS_OVERLAPPEDWINDOW | WS_VISIBLE,0, 0, 640, 480, NULL, NULL, hInstance, NULL);
      if (Window == NULL)
      {
          MessageBox (NULL,(LPCWSTR)"Error: Failed to Create Window", (LPCWSTR)"ERROR!", MB_OK);
          return (0);
      }
  
      //create button to create wall
      bCreateWall = CreateWindow((LPCWSTR)"BUTTON", (LPCWSTR)"Create Wall", WS_CHILD | WS_VISIBLE, 0, 100, DEFAULT_BUTTON_WIDTH, DEFAULT_BUTTON_HEIGHT, Window,NULL, hInstance, NULL);
      if (bCreateWall== NULL)
      {
          MessageBox (NULL, (LPCWSTR)"Error: Failed to Create Window",(LPCWSTR) "ERROR!", MB_OK);
          return (0);
      }
  
  
      Menu = LoadMenu (hInstance, MAKEINTRESOURCE(IDR_MENU));
      SetMenu (Window, Menu);
  
      while (1)
      {
          if (PeekMessage (&amp;msg, NULL, 0, 0, PM_REMOVE))
          {
              if (msg.message == WM_QUIT) break;
              TranslateMessage(&amp;msg);
              DispatchMessage (&amp;msg);
          }
      }
  
      return 1;
  }
  </code></pre>
  
  <p>When this runs, the window is blank and the menu and the button aren't added.</p>
  
  <blockquote>
    <p>the method createWindow return null </p>
  </blockquote>
  
  <p>What have I done wrong?</p>