function TForm1.GetTaskBar:integer; var abd:TAppBarData; begin abd.cbSize:=sizeof(abd); SHAppBarMessage(ABM_GETTASKBARPOS,abd); Result:=abd.rc.Bottom-abd.rc.Top; end; 任务栏的高度宽度=Screen.Width,Height-客户区的高度,宽度。
var r: TRect; begin SystemParametersInfo(SPI_GETWORKAREA, 0, @r, 0);//取得工作区大小(不含任务拦) showmessage(inttostr(screen.height - (r.Bottom - r.Top))); end; 移到右侧就用 screen.width - (r.Right - r.Left)
var r: TRect; begin GetWindowRect(FindWindow('Shell_TrayWnd', nil), r); ShowMessage(IntToStr(r.Bottom - r.Top)); // 高度 end;
var
abd:TAppBarData;
begin
abd.cbSize:=sizeof(abd);
SHAppBarMessage(ABM_GETTASKBARPOS,abd);
Result:=abd.rc.Bottom-abd.rc.Top;
end;
任务栏的高度宽度=Screen.Width,Height-客户区的高度,宽度。
r: TRect;
begin
SystemParametersInfo(SPI_GETWORKAREA, 0, @r, 0);//取得工作区大小(不含任务拦)
showmessage(inttostr(screen.height - (r.Bottom - r.Top)));
end; 移到右侧就用 screen.width - (r.Right - r.Left)
begin
GetWindowRect(FindWindow('Shell_TrayWnd', nil), r);
ShowMessage(IntToStr(r.Bottom - r.Top)); // 高度
end;