Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to determine the size of the Windows taskbar Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Determine the size of the Windows taskbar 03-Oct-02
Category
System
Language
Delphi 2.x
Views
81
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius 

How to determine the size of the Windows taskbar

Answer:

Solve 1:

You need to get the Rect in the rc member of the APPBARData structure and subtract 
the top from the bottom.

1   procedure TForm1.Button1Click(Sender: TObject);
2   var
3     appbardata: TAppBarData;
4     Rect: TRect;
5     taskBarHeight: Integer;
6   begin
7     AppBarData.cbSize := 0;
8     AppBarData.hWnd := 0;
9     AppBarData.rc.Left := 0;
10    AppBarData.rc.Top := 0;
11    AppBarData.rc.Bottom := 0;
12    AppBarData.rc.Right := 0;
13    SHAppBarMessage(ABM_GETTASKBARPOS, appbardata);
14    Rect := appbardata.rc;
15    taskBarHeight := Rect.Bottom - Rect.Top;
16    ShowMessage(IntToStr(taskBarHeight));
17  end;



Solve 2:

18  function GetTaskBarSize: TRect;
19  var
20    wnd: HWND;
21  begin
22    wnd := FindWindow('Shell_TrayWnd', nil);
23    if wnd > 0 then
24      GetWindowRect(wnd, Result)
25    else
26      Result := Rect(0, 0, 0, 0);
27  end;



Solve 3:

This is one way to get the height of the taskbar:

28  function GetTaskBarRect: TRect;
29  var
30    TBData: TAppBarData;
31  begin
32    TBData.cbSize := sizeof(TAppBarData);
33    SHAppBarMessage(ABM_GETTASKBARPOS, TBData);
34    Result := TBData.rc;
35  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC