Solved

Get Window dimensions

Posted on 2006-06-29
2
406 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

685 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