1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| function FindWindow(lpClassName, lpWindowName: PChar): Longint; external 'FindWindowA@user32.dll stdcall';
function SetWindowPos(Wnd: Longint; hWndInsertAfter: Longint; X, Y, cx, cy: Integer; uFlags: UINT): BOOL; external 'SetWindowPos@user32.dll stdcall';
var
Wnd :Longint;
begin
Exec('open', 'explorer.exe', '', '', SW_SHOW, ewWaitIdle);
//Windows XP
Wnd := FindWindow('ExploreWClass', '');
if Wnd = 0 then
//Windows Vista+
Wnd := FindWindow('CabinetWClass', '');
if Wnd <> 0 then
SetWindowPos(Wnd, 0, 0, 0, 800, 538, 0)
end. |
Partager