Wednesday, April 2, 2008

Get the taskbar height in Delphi.

This function may be useful for someone.

function TaskBarHeight: integer;
var
hTB: HWND; // taskbar handle
TBRect: TRect; // taskbar rectangle
begin
hTB:= FindWindow('Shell_TrayWnd', '');
if hTB = 0 then
Result := 0
else begin
GetWindowRect(hTB, TBRect);
Result := TBRect.Bottom - TBRect.Top;
end;
end;

4 comments:

Thom Bakker said...

Thanks! Just what i needed :)

Taqyon said...

Thank!!

Boldbayar said...

Hi,
i am happy that my post helped you. keep visiting to my blog. thanks.

Michael said...

Thanks for this.