Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
As the title says, I need to know the dimensions of a window and I do not know what api I have to use ...

I have looked unsuccessfully at GetWindowInfo, GetWindowPlacement and SetRect.

Could you please help me?


What I have tried:

As the title says, I need to know the dimensions of a window and I do not know what api I have to use ...

I have looked unsuccessfully at GetWindowInfo, GetWindowPlacement and SetRect.

Could you please help me?
Posted
Updated 26-Jun-17 0:00am

1 solution

Hi,

You aren't providing many details here, but I gather you are working with Windows forms using the Windows API. If so, I'd use GetWindowRect - see GetWindowRect function (Windows)[^] . This will give you the bounding rectangle and you can get the width, height from that rectangle.

Have fun
G
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900