Solved

a form like windows taskbar

Posted on 2003-11-21
3
310 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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks for the answers :)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

6 Experts available now in Live!

Get 1:1 Help Now