Solved

Read SDI window dimensions in Delphi

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now