//这些代码由PENGS书写在Delphi 5+Win2K 上成功!从我的一个程序中Copy来的<br>// 在程序中调用 HideDesktopAllWin 就可以啦<br>//如有不对仔细检查一下代码,修改部分就可以啦<br>//如果运行可以,[^]给点分吧<br><br><br>{-------------------------------------------------------------------------------}<br>{ ShowWinNoAnimate }<br><br>function GetAnimation: Boolean;<br>var<br> Info: TAnimationInfo;<br>begin<br> Info.cbSize := SizeOf(TAnimationInfo);<br> if SystemParametersInfo(SPI_GETANIMATION, SizeOf(Info), @Info, 0) then<br> Result := Info.iMinAnimate <> 0 else<br> Result := False;<br>end;<br><br>procedure SetAnimation(Value: Boolean);<br>var<br> Info: TAnimationInfo;<br>begin<br> Info.cbSize := SizeOf(TAnimationInfo);<br> BOOL(Info.iMinAnimate) := Value;<br> SystemParametersInfo(SPI_SETANIMATION, SizeOf(Info), @Info, 0);<br>end;<br><br>procedure ShowWinNoAnimate(Handle: HWnd; CmdShow: Integer);<br>var<br> Animation: Boolean;<br>begin<br> Animation := GetAnimation;<br> if Animation then SetAnimation(False);<br> ShowWindow(Handle, CmdShow);<br> if Animation then SetAnimation(True);<br>end;<br>procedure HideDesktopAllWin(Sender: TObject);<br> function EnumWindowsProc (Wnd: HWND; LParam: LPARAM): BOOL; stdcall;<br> begin<br> Result := True;<br> if (IsWindowVisible(Wnd)) and<br> (GetWindowLong(Wnd, GWL_HWNDPARENT) = 0) and<br> (GetWindowLong(Wnd, GWL_EXSTYLE) and WS_EX_TOOLWINDOW = 0) then<br> begin<br> ShowWinNoAnimate(Wnd, SW_MINIMIZE);<br> end;<br> end;<br>var<br> Param : Longint;<br>begin<br> Param := 0;<br> EnumWindows(@EnumWindowsProc , Param);<br> SetForegroundWindow(FindWindow(PChar('ProgMan'), nil));<br> SetActiveWindow(FindWindow(PChar('ProgMan'), nil));<br>end;