您现在的位置:首页 >> 硬件系统 >> 硬件系统 >> 内容

Delphi中三种方法获取Windows任务栏的高度

时间:2011/9/3 15:17:53 点击:

  核心提示:ShowMessage(IntToStr(GetSystemMetrics(SM_CYSCREEN)-GetSystemMetrics(SM_CYFULLSCREEN)-GetSystemMetric...

ShowMessage(IntToStr(GetSystemMetrics(SM_CYSCREEN)-GetSystemMetrics(SM_CYFULLSCREEN)-GetSystemMetrics(SM_CYCAPTION)));

 

function GetSystemTaskBarHeight:Integer;
var
  R:TRect;
begin
  SystemParametersInfo(SPI_GETWORKAREA,0,@R,0);
  Result:=Screen.Height-R.Bottom;
end;

//注需要引用ShellAPI单元

function GetTaskBarRect: Integer;
var
  TBData: TAPPBARDATA;
begin
  TBData.cbSize := SizeOf(TAPPBARDATA);
  SHAppBarMessage(ABM_GETTASKBARPOS, TBData);
  Result   :=Screen.Height-TBData.rc.Top;
end;

作者:站长 来源:原创
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号