Solved

a form like windows taskbar

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 76
Firemonkey allowing RTL on android 6 56
Firemonkey BASS_Init into a thread 17 54
Delphi android app hide keyboard 3 41
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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