本文整理自网络,侵删。
调用Windows API 函数 SystemParametersInfo 传送SPI_GETWORKAREA 参数和矩形结构的地址来接收坐标。
例子:
procedure TForm1.Button1Click(Sender: TObject);
var
hRect : TRect;
begin
SystemParametersInfo(SPI_GETWORKAREA,0,@hRect, 0);
ShowMessage(IntToStr(hRect.Top)
+ ' ' + IntToStr(hRect.Left)
+ ' ' + IntToStr(hRect.Bottom)
+ ' ' + IntToStr(hRect.Right));
end;
相关阅读 >>
Delphi tscreen 类 - 通过 screen 更换光标
Delphi 使用firedac打开sqlite数据库韩文、阿拉伯文出现乱码的处理方法
更多相关阅读请进入《Delphi》频道 >>