0
我想尽量减少系统中运行的所有应用程序,除了我的。 我该怎么做?如何最小化除我以外的所有应用程序?
我用这个代码,但它仅适用于一些电脑:
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;
。
德尔福XE /赢XP/Win 7的
419感觉有点无证... –
如果你延迟BringToFront甚至更多,说延迟(1500)? –
如果您无法完全控制在该系统上安装的内容,则无法可靠地执行此操作,也不应该这样做。这与[我如何创建一个永远不被其他顶级窗口覆盖的最顶层窗口]非常相似(http://blogs.msdn.com/b/oldnewthing/archive/2011/03/10/10138969.aspx) –