title: Getting the width and height of the client area of a window
body: <p>The accepted answer in this <a href="https://stackoverflow.com/questions/615551/how-to-get-width-and-height-from-createwindowex-window-c">question</a> says the following about getting the width and height of the client area of a window:</p>
  
  <blockquote>
  <pre><code>RECT rect;
  if(GetWindowRect(hwnd, &amp;rect))
  {
    int width = rect.right - rect.left;
    int height = rect.bottom - rect.top;
  }
  </code></pre>
  </blockquote>
  
  <p>But I don't understand why not just do the following:</p>
  
  <pre><code>RECT rect;
  if(GetWindowRect(hwnd, &amp;rect))
  {
    int width = rect.right;
    int height = rect.bottom;
  }
  </code></pre>
  
  <p>Since the documentation for <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd162897(v=vs.85).aspx" rel="nofollow noreferrer">GetClientRect()</a> says the following:</p>
  
  <blockquote>
    <p>Because client coordinates are relative to the upper-left corner of a
    window's client area, the coordinates of the upper-left corner are
    (0,0).</p>
  </blockquote>
  
  <p>My guess is that this is just a general example of how to get the width and height from a <code>RECT</code>, or maybe I am missing something!</p>