title: Win32 client size and an incorrect size
body: <p>So for a game project I am creating a game window (of course), but I only know the client size of the window and not the actual size. I know how to calculate the size but I am getting incorrect results when I am testing to see the size of the client area (should be the same as the input).</p>
  
  <pre><code>void NewWindow(width, height)
  {
      // Code setting things up here.
          if (!fullscreen) // Convert client size to window size.
          {
              style = WS_OVERLAPPEDWINDOW;
  
              RECT r = RECT();
              r.top = 0;
              r.bottom = height;
              r.left = 0;
              r.right = width;
  
              AdjustWindowRect(&amp;r, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX |     WS_MAXIMIZEBOX, FALSE);
  
              w = r.right;
              h = r.bottom;
          }
  
          hWnd = CreateWindow(CLASS_NAME, title, style, CW_USEDEFAULT, CW_USEDEFAULT, w, h, NULL, NULL, GetModuleHandle(NULL), (LPVOID)NULL);
  }
  </code></pre>
  
  <p>And the code for getting the client size is:</p>
  
  <pre><code>Size Game::GetClientSize()
  {
      RECT r = RECT();
      GetClientRect(hWnd, &amp;r);
  
      return Size(r.right - r.left, r.bottom - r.top);
  }
  </code></pre>
  
  <p>I am not sure where the problem is, because AdjustWindowRect seems to be outputting a value larger than what I put in...</p>
  
  <p>Thanks,
  Philip</p>