极域有个好用的功能,关闭所有程序
但我现在喜欢用凌波,凌波没有这个功能,所以用au3写了个小程序。
论坛程序老了传不了附件,上代码- #include <MsgBoxConstants.au3>
- Example()
- Func Example()
- ; Retrieve a list of window handles.
- $aExplorer = ProcessList("explorer.exe")
- Local $aList = WinList()
- ; Loop through the array displaying only visable windows with a title.
- For $i = 1 To $aList[0][0]
- If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
- $killID = WinGetProcess($aList[$i][1])
- $KK = 1
- For $j = 1 To $aExplorer[0][0]
- If $aExplorer[$j][1] = $killID Then
- $KK = 0
- ;MsgBox(1,$aList[$i][0],"")
- ;If Not StringInStr($aList[$i][0],"Program Manager") Then WinClose($aList[$i][1])
- ExitLoop
- EndIf
- Next
- If $KK = 0 Then
- If StringInStr($aList[$i][0], "Program Manager") Or StringInStr($aList[$i][0], "开始") Then ContinueLoop
- EndIf
- WinClose($aList[$i][1])
- EndIf
- Next
- Local $aList = WinList()
- ; Loop through the array displaying only visable windows with a title.
- For $i = 1 To $aList[0][0]
- If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
- $killID = WinGetProcess($aList[$i][1])
- $KK = 1
- For $j = 1 To $aExplorer[0][0]
- If $aExplorer[$j][1] = $killID Then
- $KK = 0
- ;MsgBox(1,$aList[$i][0],"")
- ;If Not StringInStr($aList[$i][0],"Program Manager") Then WinClose($aList[$i][1])
- ExitLoop
- EndIf
- Next
- If $KK Then ProcessClose($killID)
- EndIf
- Next
- EndFunc ;==>Example
复制代码 |