Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Desktop boundaries

Posted on 2001-07-19
3
Medium Priority
?
179 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 80 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] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

718 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