找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1349|回复: 6

[辅助教学] 关闭所有可见窗口程序

[复制链接]
发表于 2025-3-19 17:35:01 | 显示全部楼层 |阅读模式
极域有个好用的功能,关闭所有程序
但我现在喜欢用凌波,凌波没有这个功能,所以用au3写了个小程序。
论坛程序老了传不了附件,上代码
  1. #include <MsgBoxConstants.au3>
  2. Example()
  3. Func Example()
  4.     ; Retrieve a list of window handles.
  5.     $aExplorer = ProcessList("explorer.exe")
  6.     Local $aList = WinList()
  7.     ; Loop through the array displaying only visable windows with a title.
  8.     For $i = 1 To $aList[0][0]
  9.         If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
  10.             $killID = WinGetProcess($aList[$i][1])
  11.             $KK = 1
  12.             For $j = 1 To $aExplorer[0][0]
  13.                 If $aExplorer[$j][1] = $killID Then
  14.                     $KK = 0
  15.                     ;MsgBox(1,$aList[$i][0],"")
  16.                     ;If Not StringInStr($aList[$i][0],"Program Manager") Then WinClose($aList[$i][1])
  17.                     ExitLoop
  18.                 EndIf
  19.             Next
  20.             If $KK = 0 Then
  21.                 If StringInStr($aList[$i][0], "Program Manager") Or StringInStr($aList[$i][0], "开始") Then ContinueLoop
  22.             EndIf
  23.             WinClose($aList[$i][1])
  24.         EndIf
  25.     Next
  26.     Local $aList = WinList()
  27.     ; Loop through the array displaying only visable windows with a title.
  28.     For $i = 1 To $aList[0][0]
  29.         If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
  30.             $killID = WinGetProcess($aList[$i][1])
  31.             $KK = 1
  32.             For $j = 1 To $aExplorer[0][0]
  33.                 If $aExplorer[$j][1] = $killID Then
  34.                     $KK = 0
  35.                     ;MsgBox(1,$aList[$i][0],"")
  36.                     ;If Not StringInStr($aList[$i][0],"Program Manager") Then WinClose($aList[$i][1])
  37.                     ExitLoop
  38.                 EndIf
  39.             Next
  40.             If $KK Then ProcessClose($killID)
  41.         EndIf
  42.     Next
  43. EndFunc   ;==>Example
复制代码
回复

使用道具 举报

发表于 2025-3-20 14:36:58 | 显示全部楼层
          
回复

使用道具 举报

发表于 2025-3-20 19:38:15 | 显示全部楼层
感谢分享
回复

使用道具 举报

发表于 2025-4-16 08:28:36 | 显示全部楼层
感谢楼主分享
回复

使用道具 举报

发表于 2025-4-16 11:22:18 | 显示全部楼层
真香!
回复

使用道具 举报

发表于 2025-4-16 20:57:50 | 显示全部楼层
怎么使用?能编译一下吗?放在蓝奏网盘也行的
回复

使用道具 举报

发表于 2025-4-18 08:33:52 | 显示全部楼层
现在只用极域,凌波是偶尔被这帮人逃离极域时重启他们机器的手段,不让他们知道凌波的存在。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|腾飞在线 ( 冀ICP备05002530号 )

GMT+8, 2026-2-13 11:18 , Processed in 0.054180 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表