RevoltPlz
RevoltPlz

Reputation: 225

How can i find the size of a window?

For example if i got this window (which is not part of this project): Example Is there a way to get the size of this window? (int x and y)

Thanks, Revolt

Upvotes: 0

Views: 656

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 596256

If you have the HWND of the window then you can use GetWindowRect() or GetWindowPlacement() to get its position and dimensions.

Update: On Vista and later, GetWindowRect() can report values that do not take Glass/Aero into account. To account for that, you can use DwmGetWindowAttribute() with the DWMWA_EXTENDED_FRAME_BOUNDS attribute instead.

Upvotes: 1

Related Questions