Solved

Read SDI window dimensions in Delphi

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

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