Solved

Read SDI window dimensions in Delphi

Posted on 2008-10-20
3
400 Views
Last Modified: 2011-10-19
Hello,

  I need to create a Delphi active X control to take a passed windows handle and find out the internal dimensions of the window.  The form is from an SDI program (Axapta 3.0) and I need to be able to find out the screen size from the bottom of the main menu to the top of the status bar (The attached file is a jpeg of the main screen.  Since all the forms appear inside this frame, I need to get the frame dimensions.  Is there any windows mechanism for finding this out?

Tom T.
Image1.jpg
0
Comment
Question by:tturney
[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
3 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 22760098
try: GetClientRect()

p.s. you meant you have MDI not SDI:)

ziolko.
0
 

Author Comment

by:tturney
ID: 22771314
Ziolko,

  Your right, I meant MDI.  The problem with GetClientRec() is that it gives me windows dimensions and not the client area.  I tried SystemParametersInfo with SPI_GETWORKAREA, but the same result.

Tom T.
0
 
LVL 21

Accepted Solution

by:
ziolko earned 500 total points
ID: 22773948
SystemParametersInfo() with SPI_GETWORKAREA will give you work area of primary monitor not client area of application. GetClientRect() should give you dimmensions of client area of window which handle is passed as parameter.
right and bottom members of rect structure should contain width and height of client area but to be honest I'm not sure if main menu and toolbar are included in client area

ziolko.
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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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