- ;最大化暂停小黑盒动态壁纸播放.ahk
- ;Code by OldLiu.
- ;需要tool.exe第三方。
-
- SetWorkingDir %A_ScriptDir%
- IsWallPaperPaused := 0
- Loop
- {
- Sleep 1000
- Process Exist,maxwallpaper.exe
- WallPaperPID := ErrorLevel
- If(WallPaperPID)
- {
- ;遍历窗口查询是否有窗口最大化。
- IsSomeWindowsMaximized := 0
- WinGet id, List
- Loop %id%
- {
- WinGet IsActiveWindowMaximized, MinMax, % "ahk_id " . id%A_Index%
- IsSomeWindowsMaximized := Max(IsSomeWindowsMaximized,IsActiveWindowMaximized)
- }
- ;若有窗口最大化,暂停壁纸播放。
- If(IsSomeWindowsMaximized && !IsWallPaperPaused)
- {
- Run tool.exe -pauseprocess %WallPaperPID%,,Hide
- IsWallPaperPaused := 1
- }
- ;若无窗口最大化,恢复壁纸播放。
- If(!IsSomeWindowsMaximized && IsWallPaperPaused)
- {
- Run tool.exe -goonprocess %WallPaperPID%,,Hide
- IsWallPaperPaused := 0
- }
- }
- }
复制代码
|