Solved

Desktop boundaries

Posted on 2001-07-19
3
175 Views
Last Modified: 2010-04-06
Howdy guys!

I need to position my form at the bottom right corner of the screen. I got that working through:

  Top := Screen.Height-Height-Y;
  Left := Screen.Width-Width-X;

But when I have for example ICQ at the right-hand corner, "attached" to the edge of the screen, my form is still in the same position, but blocked behind the ICQ window. Thus I'll need the coordinates of the desktop area.

Or if anyone has any other idea of something that would fix this, I'd be happy if you'd share it. =)


Have a nice day! :o)

Johan
0
Comment
Question by:sageryd
[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
3 Comments
 

Expert Comment

by:Richard_Yu
ID: 6297416
In my program I set my main form's position by add the following code in FormCreate:

Self.Top := Screen.Height - 28 - Self.Height;//28 is the height of Windows task bar
Self.Left := Screen.Width - Self.Width;

It work's fine so I think it maybe useful for you.
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 20 total points
ID: 6297438
Try this:

var rect: TRect;
begin
  SystemParametersInfo(SPI_GETWORKAREA, 0, @rect, 0);
  Label1.Caption := IntToStr(rect.Left);
  Label2.Caption := IntToStr(rect.Top);
  Label3.Caption := IntToStr(rect.Right);
  Label4.Caption := IntToStr(rect.Bottom);
end;
0
 
LVL 1

Author Comment

by:sageryd
ID: 6297531
Thanx! Works excellent.

var Rect: TRect;
begin
  SystemParametersInfo(SPI_GETWORKAREA, 0, @rect, 0);
  Top := Rect.Bottom-Height-5;
  Left := Rect.Right-Width-5;
end;


Richard, the height of the taskbar can vary.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

623 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