Delphi Form State and State Size
In delphi maximized form, how to get shape, restored position and state size? I know that in .NET we use RestoreBounds
and DesktopBound
.
+3
Thiago dias
source
to share
1 answer
This is not visible within the VCL. Instead, you need to dive into the Win32 API. You need a function GetWindowPlacement
.
var
WindowPlacement: TWindowPlacement;
....
WindowPlacement.length := SizeOf(WindowPlacement);
Win32Check(GetWindowPlacement(Form.Handle, WindowPlacement));
The required information can be found in the structure WindowPlacement
. Beware that coordinates are reported relative to the stage, not the screen.
You usually need this information so you can recover it later. Use SetWindowPlacement
for this.
+6
David Heffernan
source
to share