Jump to content

  • Log In with Google      Sign In   
  • Create Account

Win32 get current window size function?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Sanadan   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 June 2003 - 08:12 AM

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.

Sponsor:

#2 drowner   Members   -  Reputation: 175

Like
Likes
Like

Posted 25 June 2003 - 09:28 AM

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]

#3 Russell   Members   -  Reputation: 118

Like
Likes
Like

Posted 25 June 2003 - 12:31 PM

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

#4 Oluseyi   Staff Emeritus   -  Reputation: 1678

Like
Likes
Like

Posted 25 June 2003 - 02:19 PM

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.

#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 25 June 2003 - 02:39 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS