Q:

Getting the width and height of the client area of a window

The accepted answer in this question says the following about getting the width and height of the client area of a window:

RECT rect;
if(GetWindowRect(hwnd, &rect))
{
  int width = rect.right - rect.left;
  int height = rect.bottom - rect.top;
}

But I don't understand why not just do the following:
RECT rect;
if(GetWindowRect(hwnd, &rect))
{
  int width = rect.right;
  int height = rect.bottom;
}

Since the documentation for GetClientRect() says the following:

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).

My guess is that this is just a general example of how to get the width and height from a RECT, or maybe I am missing something!

A:

The example you give calls GetWindowRect rather than GetClientRect. And so returns screen coordinates rather than client coordinates. Hence it would be wrong to assume that the top left was at 0, 0. 
Note therefore that the code you present calculates the window width and height rather than the client area width and height.
If you want the dimensions of the client area then call GetClientRect instead. And, as you observe, the returned rectangle will have top left at 0, 0. 

