Win32 get current window size function?

Started by
3 comments, last by Sanadan 20 years, 9 months ago
I want to know if there is a function that will return the current size of the current window. I have found reference of how to get the max and minimum sizes of the current window, but I can''t seem to find anything on google about how to get the current size of the current window. I want to do this in straight WIN32 API, no MFC, no DirectX, no OpenGL.
Advertisement
RECT rc;
GetClientRect(hWnd,&rc);

or GetWindowRect(hWnd,&rc);



------------------------------------------------------------
// TODO: Insert clever comment here.

[edited by - drowner on June 25, 2003 4:30:58 PM]
------------------------------------------------------------// TODO: Insert clever comment here.
Not that there is a difference between GetClientRect and GetWindowRect. If you want the size of a window, you probably want GetClientRect (but I think you could compute it from either).
quote:Original post by Russell
Not that there is a difference between GetClientRect and GetWindowRect.
Actually, there is a difference between the two. GetWindowRect returns the dimensions of the entire window - frame, menus, etc - while GetClientRect returns the dimensions of the client or drawable area alone.
GetWindowRect also returns screen coords, whereas GetClientRect always returns 0s for left and top and the width in right and the height in bottom. that''s because GetWindowRect''s coords are relative to the desktop origin and GetClientRect''s coords are relative to the given window''s client area.

This topic is closed to new replies.

Advertisement