Solved

a form like windows taskbar

Posted on 2003-11-21
3
312 Views
Last Modified: 2010-04-05
hello again :)
i'd like to make a form which is similar to windows taskbar. i want to align it to the top of monitor so that maximized windows do not overlay it.
is it possible? if yes, how?
please help ..
0
Comment
Question by:ZhaawZ
3 Comments
 
LVL 3

Accepted Solution

by:
raidos earned 50 total points
ID: 9797704
Sure it is...

Var
  aRect: TRect;
Begin
Form1.Top := 0;
Form1.Left := 0;
Form1.Width := Screen.Width;
Form1.Height := 22;

Form1.FormStyle := fsStayOnTop;
aRect.Top := 23;
aRect.Left := 0;
aRect.Width := Screen.Width;
aRect.Height := Screen.Height;

SystemParametersInfo(SPI_SETWORKAREA, 0, @aRect, 0);

end;

Should do the trick..

Regards
//raidos
0
 
LVL 17

Expert Comment

by:geobul
ID: 9797712
Hi,

Try this:

var
  Form1: TForm1;
  rectOri: TRect;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
  rect: TRect;
begin
  Left := Screen.DesktopLeft;
  Top := Screen.DesktopTop;
  Width := Screen.DesktopWidth;
  Height := 50; // your form height here

  // Get the current available work area
  SystemParametersInfo(SPI_GETWORKAREA, 0, @rectOri, 0);

  // Subtract the rect
  SubtractRect(rect, rectOri, Classes.Rect(Left, Top, Width, Height));

  // Set this to be the new available work area
  SystemParametersInfo(SPI_SETWORKAREA, 0, @rect, 0);
end;

procedure TForm1.FormDestroy(Sender: TObject);
var
  rect: TRect;
begin
  // restore rectOri
  SystemParametersInfo(SPI_SETWORKAREA, 0, @rectOri, 0);
end;

Regards, Geo
0
 
LVL 11

Author Comment

by:ZhaawZ
ID: 9797885
thanks for the answers :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 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

10 Experts available now in Live!

Get 1:1 Help Now