Solved

Desktop boundaries

Posted on 2001-07-19
3
174 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

Independent Software Vendors: 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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…

710 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