Solved

a form like windows taskbar

Posted on 2003-11-21
3
314 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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