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
Solved

Read SDI window dimensions in Delphi

Posted on 2008-10-20
3
398 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
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…

789 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