+2  A: 

I think what you're looking for is SM_CYCAPTION -- that's the height of the title bar. SM_CYBORDER is the height of the horizontal edges of a window.

Head Geek
+1  A: 

Head Geek gives the detailed answer: use GetSystemMetrics to add up the caption and border bits. You can also do a difference on width/height between the GetWindowRect and GetClientRect. This will give you the total of all captions/borders/etc.

GetSystemMetics on MSDN: http://msdn.microsoft.com/en-us/library/ms724385(VS.85).aspx
stukelly
+6  A: 

The GetWindowRect and GetClientRect functions can be used calculate the size of all the window borders.

Suite101 has a article on resizing a window and the keeping client area at a know size.

Here is there sample code:

void ClientResize(HWND hWnd, int nWidth, int nHeight)
{
  RECT rcClient, rcWind;
  POINT ptDiff;
  GetClientRect(hWnd, &rcClient);
  GetWindowRect(hWnd, &rcWind);
  ptDiff.x = (rcWind.right - rcWind.left) - rcClient.right;
  ptDiff.y = (rcWind.bottom - rcWind.top) - rcClient.bottom;
  MoveWindow(hWnd,rcWind.left, rcWind.top, nWidth + ptDiff.x, nHeight + ptDiff.y, TRUE);
}
stukelly
There's a WinAPI function to resize the window to have a given client area size: AdjustWindowRectEx()
MrZebra
I think I'll stick with the GetWindowRect() - GetClientRect() method.That way I don't have to mess with window styles from heck.Which is the same problem I'll have with GetSystemMetrics(whatever)...Thanks everyone - this place rocks :)
Stephen Hazel
A: 

Read MSDN and Google Groups for so basic questions answered thousands of times. (and the ClientResize has no sense...)

Hmm, ok, well I didn't see an answer on THIS site...
Stephen Hazel