If I double click top border of a window it will resize vertically from top to the bottom of the desktop, but retain its width.
How do I do it in code?
If I double click top border of a window it will resize vertically from top to the bottom of the desktop, but retain its width.
How do I do it in code?
Probably by just this code:
with Screen.MonitorFromWindow(Handle).WorkareaRect do
SetBounds(Self.Left, Top, Self.Width, Height);
And the following alternative adds an animation:
Hide;
with Screen.MonitorFromWindow(Handle).WorkareaRect do
SetBounds(Self.Left, Top, Self.Width, Height);
AnimateWindow(Handle, 200, AW_ACTIVATE or AW_VER_POSITIVE);
To be able to restore to the previous size, I thought SetWindowPlacement
could be used, but I cannot make it work though.