bfgxp 发表于 2025-3-19 17:35:01

关闭所有可见窗口程序

极域有个好用的功能,关闭所有程序
但我现在喜欢用凌波,凌波没有这个功能,所以用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
      If $aList[$i] <> "" And BitAND(WinGetState($aList[$i]), 2) Then
            $killID = WinGetProcess($aList[$i])
            $KK = 1
            For $j = 1 To $aExplorer
                If $aExplorer[$j] = $killID Then
                  $KK = 0
                  ;MsgBox(1,$aList[$i],"")
                  ;If Not StringInStr($aList[$i],"Program Manager") Then WinClose($aList[$i])
                  ExitLoop
                EndIf
            Next
            If $KK = 0 Then
                If StringInStr($aList[$i], "Program Manager") Or StringInStr($aList[$i], "开始") Then ContinueLoop
            EndIf
            WinClose($aList[$i])
      EndIf
    Next
    Local $aList = WinList()
    ; Loop through the array displaying only visable windows with a title.
    For $i = 1 To $aList
      If $aList[$i] <> "" And BitAND(WinGetState($aList[$i]), 2) Then
            $killID = WinGetProcess($aList[$i])
            $KK = 1
            For $j = 1 To $aExplorer
                If $aExplorer[$j] = $killID Then
                  $KK = 0
                  ;MsgBox(1,$aList[$i],"")
                  ;If Not StringInStr($aList[$i],"Program Manager") Then WinClose($aList[$i])
                  ExitLoop
                EndIf
            Next
            If $KK Then ProcessClose($killID)
      EndIf
    Next
EndFunc   ;==>Example

wangzhang 发表于 2025-3-20 14:36:58

gameboys2000 发表于 2025-3-20 19:38:15

感谢分享

爱琴海 发表于 2025-4-16 08:28:36

感谢楼主分享

slmok 发表于 2025-4-16 11:22:18

真香!

lidongyun 发表于 2025-4-16 20:57:50

怎么使用?能编译一下吗?放在蓝奏网盘也行的

hkl7366 发表于 2025-4-18 08:33:52

现在只用极域,凌波是偶尔被这帮人逃离极域时重启他们机器的手段,不让他们知道凌波的存在。
页: [1]
查看完整版本: 关闭所有可见窗口程序