Solved

Get Window dimensions

Posted on 2006-06-29
2
401 Views
Last Modified: 2008-03-03
I am writing a win32 application, which draws an ellipse to the size of the form.  The problem is it draws the left
and right too big.  I am currently using GetWindowRect to get the size of the window.  How can I get the true right
and bottom values of the DRAWABLE area?  I know I could keep guessing until it looks right, but I assume that will
be inaccurate when moving to other computers.
0
Comment
Question by:List244
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 17015044
Just use 'GetClientRect()', that's the information you are looking for - see http://windowssdk.msdn.microsoft.com/en-us/library/ms633503.aspx ("GetClientRect"):

"The GetClientRect function retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0)."
0
 
LVL 8

Author Comment

by:List244
ID: 17015178
Perfect, thanks.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now