MARIA_MAR,
Cita:
Empezado por nlsgarcia
1- Con la función SetForegroundWindow se puede establecer el tamaño, posición y orden Z de una ventana en Windows
|
Corrección: No es la función
SetForegroundWindow, es la función
SetWindowPos.
Cita:
Empezado por MARIA_MAR
¿cómo puedo yo redimensionar la ventana en la que se ejecuta este programa Windows sin llegar a minimizarla?
|
Puedes usar tambien la función
MoveWindow para mover y redimensionar una ventana:
Código:
BOOL MoveWindow(
HWND hWnd, // handle of window
int X, // horizontal position
int Y, // vertical position
int nWidth, // width
int nHeight, // height
BOOL bRepaint // repaint flag
);
Revisa este código:
Código Delphi
[-]
procedure TForm5.Button2Click(Sender: TObject);
var
x, y : Integer;
cx, cy : Integer;
Window : Integer;
begin
x := Round(form5.Top/2);
y := Round(form5.Left/2);
cx := Round(form5.Height/2);
cy := Round(form5.Width/2);
ShellExecute(Handle, 'open', 'Notepad.exe', nil, nil, SW_HIDE);
Sleep(150);
Window := FindWindow('Notepad',nil);
if SetForegroundWindow(Window) = True then
begin
MoveWindow(Window,x, y, cx, cy, true);
ShowWindow(Window, SW_SHOWNORMAL);
end
else
MessageDlg('Notepad No Esta Activo', mtInformation,[mbOk], 0);
end;
Espero sea útil
Nelson.