桌面区大小和得到任务栏的高度

有什么函数可以得到桌面区大小和得到任务栏的高度? 
--------------------------------------------------------------- 
 
 
任务栏的高度? 
 
uses  shellapi; 
procedure  TForm1.Button1Click(Sender:  TObject);
var
abd:TAppBarData;
begin
abd.cbSize:=sizeof(abd);
SHAppBarMessage(ABM_GETTASKBARPOS,abd);
Caption:=IntToStr(abd.rc.Bottom-abd.rc.Top);
end; 
 
--------------------------------------------------------------- 
 
Screen.Height  -  Screen.WorkAreaHeight 
--------------------------------------------------------------- 
 
得到桌面区的大小,你可以试着用这个API函数: 
SystemParametersInfo; 
 
具体使用如下: 
 
var 
ARect:TRect; 
begin 
SystemParametersInfo(SPI_GETWORKAREA,0,@ARect,0); 
{其中  ARect  就包含了你所要的桌面区的大小} 
end; 
 
你试试看吧! 
--------------------------------------------------------------- 
 
API函数是SystemParamInfo函数! 
--------------------------------------------------------------- 
 
用Screen中的方法和属性就可以操作了,包括多显示器问题,DELPHI中已经将其封装好了,不用调用什么API。 
它在Forms单元中定义,可以直接使用。

posted @ 2010-10-21 16:25  lenya  阅读(173)  评论(0编辑  收藏  举报