nohj
asked on
Taskbar height
Using Delphi 3 Pro
How can I get the height of the Windows taskbar so that I can make my forms scale and still leave the task bar visible ?
Thanks
How can I get the height of the Windows taskbar so that I can make my forms scale and still leave the task bar visible ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Tell me if you have difficulties in implementing that.
I think Kotik is correct, I think that the only way to resize the task bar is by generating the onmouse drag event, you cannot simply set the properties, I tried this but failed.
bert.
bert.
Well, here it is:
procedure TForm1.Button1Click(Sender : TObject);
var
r : TRect;
begin
SystemParametersInfo(SPI_G ETWORKAREA ,
0,
@r,
0);
ShowMessage(IntToStr(r.Bot tom - r.Top));
end;
procedure TForm1.Button1Click(Sender
var
r : TRect;
begin
SystemParametersInfo(SPI_G
0,
@r,
0);
ShowMessage(IntToStr(r.Bot
end;
But I think it is easier to set Form1.WindowsState to swMaximized. Now you don't have to worry about anything
Cheers,
Epsylon.
Cheers,
Epsylon.
Of course I mean wsMaximized.... :o)
This is a definative way of getting the dimensions of the task bar.
procedure TForm1.Button1Click(Sender : TObject);
var
wnd:HWND;
Rct:TRect;
begin
Wnd:=FindWindow('Shell_Tra yWnd', nil);
GetWindowRect(Wnd,Rct);
ShowMessage('Rect is:'+#10+#13+
' Left='+IntToStr(rct.left)+ #10+#13+
' Top='+IntToStr(rct.top)+#1 0+#13+
' Bottom='+IntToStr(rct.Bott om)+#10+#1 3+
' Right='+IntToStr(rct.Right ));
end;
procedure TForm1.Button1Click(Sender
var
wnd:HWND;
Rct:TRect;
begin
Wnd:=FindWindow('Shell_Tra
GetWindowRect(Wnd,Rct);
ShowMessage('Rect is:'+#10+#13+
' Left='+IntToStr(rct.left)+
' Top='+IntToStr(rct.top)+#1
' Bottom='+IntToStr(rct.Bott
' Right='+IntToStr(rct.Right
end;
hi all,
one remark, if allowed,
the taskbar can also be on the side or on the top, not only on the bottom.
meikl
one remark, if allowed,
the taskbar can also be on the side or on the top, not only on the bottom.
meikl
hi again,
an additional remark, if allowed,
eps is right to maximize the form,
this do never hide a standing taskbar.
meikl
an additional remark, if allowed,
eps is right to maximize the form,
this do never hide a standing taskbar.
meikl
ASKER
I used
SystemParametersInfo(SPI_G ETWORKAREA ,0,@WinRec t,0);
WinRect is a TRect;
Thanks
SystemParametersInfo(SPI_G
WinRect is a TRect;
Thanks
Strange.....