Update Window Position And Size - Delphi
DarkCoderSc
Jean-Pierre LESUEUR
var ATargetWindow := FindWindow(nil, 'Untitled - Notepad');
if ATargetWindow = 0 then
Exit();
var ANewRect : TRect; // Or := Rect(..,..,..,..)
ANewRect.Left := 10;
ANewRect.Top := 10;
ANewRect.Width := 400;
ANewRect.Height := 200;
// Just Move Window
SetWindowPos(ATargetWindow, 0, ANewRect.Left, ANewRect.Top, 0, 0, SWP_NOZORDER or SWP_NOSIZE);
// Just Resize Window
SetWindowPos(ATargetWindow, 0, 0, 0, ANewRect.Width, ANewRect.Height, SWP_NOZORDER or SWP_NOMOVE);
// Both
SetWindowPos(ATargetWindow, 0, ANewRect.Left, ANewRect.Top, ANewRect.Width, ANewRect.Height, SWP_NOZORDER);
Implemented By Technique
Featured Windows API
Created
April 24, 2025
Last Revised
April 24, 2025
Window Actions