Я хочу свести к минимуму все приложения, работающие в системе, кроме моего.
Как я могу это сделать?
Я использовал этот код, но он работает только на некоторых компьютерах:
procedure MinAllWnd_ByShell;
VAR IntHwnd: Integer;
begin
IntHwnd:= FindWindow('Shell_TrayWnd', nil);
PostMessage(IntHwnd, WM_COMMAND, 419, 0);
end;
тогда
procedure TFrmMain.btnMinimizeAll_Click(Sender: TObject);
begin
{ Send MINIMIZE message }
MinAllWnd_ByShell; { This sends a message to Windows. Windows sends the minimize signal back to us after a delay }
Delay(150); { We wait few miliseconds to receive the message in our message queue }
Application.ProcessMessages; { By now we should have received the message so we process the queue. }
{ Now self restore }
BringToFront;
ShowWindow(frmMain.Handle, SW_RESTORE);
end;
.
Delphi XE / Win XP / Win 7