Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Win32 get current window size function?

4: Adsense

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   

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.

#2 drowner   Members   

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   

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   Members   

2076
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   

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.