This site is temporarily down. Please come back. Taskbar hides windows/ size of taskbar
DelphiFAQ Home Search:

Taskbar hides windows/ size of taskbar

 

comments1 comments. Current rating: 4 stars (1 votes). Leave comments and/ or rate it.

Sometimes the taskbar covers a part of your application window and you would like to avoid that.
The following procedure shows how to retrieve the size of the taskbar ('tray window');
the key information is the internal window's classname Shell_TrayWnd:

procedure TForm1.Button1Click(Sender: TObject);
var
  Tasklist : HWnd;
  Bordered : TRect;
begin
  Tasklist := FindWindow('Shell_TrayWnd', nil);
  GetWindowRect(Tasklist, Bordered);
  Label1.Caption := 'Left: '   + IntToStr(Bordered.Left);
  Label2.Caption := 'Right: '  + IntToStr(Bordered.Right);
  Label3.Caption := 'Top: '    + IntToStr(Bordered.Top);
  Label4.Caption := 'Bottom: ' + IntToStr(Bordered.Bottom);
end;

Note:
The taskbar window is always two pixels broader or higher than the screen,
e.g. at a screen resolution of 800x600, the with would be 802 pixels.
Content-type: text/html

Comments:

2006-06-05, 23:07:29
anonymous from Russian Federation  
rating
Thanks a lot! It really works fine!

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: