Solved

Get Window dimensions

Posted on 2006-06-29
2
407 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Title # Comments Views Activity
Which IDE to use to begin C++ training? 5 76
Dialogbox API leak? 18 117
operator overload: incompatible type and too many params 5 96
Create a path if not exists 7 124
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

732 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