算了,高级的搞不了,就用愚公移山的办法吧,能行得通就行.#include <WinAPI.au3>
#include <WinAPIEx.au3>
$file = FileOpen("vDesk.scf",10) ;创建一个'显示桌面'的副本.
FileWriteLine($file,"[Shell]")
FileWriteLine($file,"Command=2")
FileWriteLine($file,"IconFile=explorer.exe,3")
FileWriteLine($file,"[Taskbar]")
FileWriteLine($file,"Command=ToggleDesktop")
FileClose($file)
ShellExecuteWait("vDesk.scf");执行这个动作
Sleep(1000)
Global $qWnd = _WinAPI_GetForegroundWindow();获取当前前景窗口句柄
Global Const $hWndDesktop = _WinAPI_GetDesktopWindow();桌面句宾
MsgBox(16,"",_WinAPI_GetClassName($qWnd)) ;显示所提取的句柄
While 1
Sleep(50)
;如果前景窗口为所提取的窗口就再执行一次,恢复桌面窗口为前景窗口.
If _WinAPI_GetForegroundWindow() = $qWnd Then
ShellExecuteWait("vDesk.scf")
EndIf
WEnd
已解决 |