隐藏USB屏幕助手软件窗口脚本
2025-8-22 乱云飞 评论(0) 浏览(39) 标签: 隐藏窗口 USB屏幕 USB显示器
#NoTrayIcon
#SingleInstance force
; 启动usb.exe
Run, usb.exe
WinWait, USB屏幕助手V1.0,, 5 ; 等待 5 秒
; 初始隐藏窗口和设置透明
Run, nircmd win move title "USB屏幕助手V1.0" -9999 -9999
Run, nircmd win move class "TkTopLevel" -9999 -9999
Run, nircmd win move process "usb.exe" -9999 -9999
Run, nircmd win trans title "USB屏幕助手V1.0" 0
Run, nircmd win trans class "TkTopLevel" 0
Run, nircmd win trans process "usb.exe" 0
; 热键:CTRL+ALT+0 显示窗口和取消透明并居中
^!0::
; 取消透明
Run, nircmd win trans title "USB屏幕助手V1.0" 100
Run, nircmd win trans class "TkTopLevel" 100
Run, nircmd win trans process "usb.exe" 100
; 获取窗口ID和尺寸
WinGet, hwnd, ID, USB屏幕助手V1.0
WinGetPos,,, winWidth, winHeight, ahk_id %hwnd%
; 计算居中位置
posX := (1920 - winWidth) // 2
posY := (1080 - winHeight) // 2
; 移动窗口到屏幕中央
WinMove, ahk_id %hwnd%,, %posX%, %posY%
; 激活窗口
WinActivate, ahk_id %hwnd%
return
; 热键:CTRL+ALT+X 关闭usb.exe并退出脚本
^!x::
Process, Close, usb.exe
ExitApp
return