对于这种寄宿生风格,我使用GetWindowRect:
我想总是获得完整窗口的坐标。谢谢你的帮助
答案 0 :(得分:1)
这有效:
uses
Winapi.DwmApi;
procedure TForm1.Button1Click(Sender: TObject);
var
R: TRect;
begin
if (Win32MajorVersion >= 6) and DwmCompositionEnabled then
DwmGetWindowAttribute(Handle, DWMWA_EXTENDED_FRAME_BOUNDS, @R, SizeOf(R))
else
Windows.GetWindowRect(Handle, R);
ShowMessage(IntToStr(R.Right - R.Left))
end;