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

第一种:需要引用Windows单元

[delphi]view plaincopy

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

第二种:需要引用Windows单元

[delphi]view plaincopy

  1. function GetSystemTaskBarHeight:Integer;
  2. var
  3. R:TRect;
  4. begin
  5. SystemParametersInfo(SPI_GETWORKAREA,0,@R,0);
  6. Result:=Screen.Height-R.Bottom;
  7. end;

第三种:要引用ShellAPI单元

[delphi]view plaincopy

  1. function GetTaskBarRect: Integer;
  2. var
  3. TBData: TAPPBARDATA;
  4. begin
  5. TBData.cbSize := SizeOf(TAPPBARDATA);
  6. SHAppBarMessage(ABM_GETTASKBARPOS, TBData);
  7. Result :=Screen.Height-TBData.rc.Top;
  8. end;

http://blog.csdn.net/chaijunkun/article/details/5577285