title: Error 1813 when calling CreateWindow() func WinApi
body: <p>I'm new in C++ and WinApi. I can't create a simple window in WinApi. CreateWindow() function returns null. GetLastError() func returns error 1813.
  But before creating window GetLastError() returns 0. Sorry for my English. Here is my full code:</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  
  LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
  
  int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
  {
   LPCWSTR szWindowClass = TEXT("WndClass");
   LPCWSTR szTitle = TEXT("Main window");
   DWORD dwError;
  
   WNDCLASS wc;
   wc.style = CS_OWNDC;
   wc.hInstance = hInstance;
   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.lpfnWndProc = WndProc;
   wc.lpszClassName = szWindowClass;
   wc.lpszMenuName = L"MenuName";
   dwError = GetLastError(); //0
  
   RegisterClass(&amp;wc);
   dwError = GetLastError();//0
  
  
   HWND hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);//NULL
  
   dwError = GetLastError();//1813 =(
   return 0;
  }
  
  LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
  {
   return 0;
  }
  </code></pre>