   Rect, SetRect and AdjustWindowRect Problems
  I am working from the DirectX9 SDK framework and have broken it down into a plain old window application without DX.  My problem is that I set two variables m_dwWinHeight = 300 and m_dwWinWidth = 400 but I am sure the actual window dimensions once it has gone through the various steps do not come out as such.I create a RECT structure using SetRect ( &rc, 0, 0, m_dwWinWidth, m_dwWinHeight ).  Which when debugged gives values top=0, left=0, bottom=300, right=400.I then use the AdjustWindowRect() function on the structure and add the various window style flags and a menu.Which when debugged gives top=-50, bottom=304, left=-4 and right=404.Now in the CreateWindowEx() function in the width field I use ( rc.right - rc.left ) which when debugged contains the values ( 404, -4 ) = 400 which is the value I wanted the window width to be as set in m_dwWinWidth. In the height field I use ( rc.bottom - rc.top ) which again when debugged gives ( 304, -50 ) = 254 which is not the height value I specified in m_dwWinHeight.Therefore the window is actually of the incorrect dimensions unless I am calculating this all wrong (which is probably the case).Can anyone either enlighten me on this or point me in the right direction for solving this, it would be appreciated.Thanks,Paul. 
  There''s a distinction between the "window rect" and the "client rect". The window rect includes the caption/titlebar, a status bar if any, a menu if any, and so forth. The client rect is just the drawing area. 