Link to home
Start Free TrialLog in
Avatar of andrezzzz
andrezzzz

asked on

maximise or minimise other aplication

how i can create programm who maximise and minimise otther programm's window ???
Avatar of Mike Littlewood
Mike Littlewood
Flag of United Kingdom of Great Britain and Northern Ireland image

2 buttons on a form, 1 to maximise, 1 to minimise.
This example uses notepad, but you can change the application name to anything you want.

procedure TForm1.Button1Click(Sender: TObject);
var
  myapp: Thandle;
begin
  MyApp := FindWindow(nil,'Untitled - Notepad');
  ShowWindow(MyApp,SW_MAXIMIZE);
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  myapp: Thandle;
begin
  MyApp := FindWindow(nil,'Untitled - Notepad');
  ShowWindow(MyApp,SW_MINIMIZE);
end;
Avatar of andrezzzz
andrezzzz

ASKER

but if i want minimaize or maximise all aplication.

for example i have in form timer and after every 5 seconds i want maximize one aplication ?
ASKER CERTIFIED SOLUTION
Avatar of ZhaawZ
ZhaawZ
Flag of Latvia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial