【发布时间】:2020-11-06 23:35:16
【问题描述】:
如何使用 AHK 激活处于 AlwaysOnTop 模式的 Windows10 计算器应用程序
如果您在计算器处于标准模式时单击“保持顶部”,它会变成这样
请注意,它没有标题栏
我用来激活已经打开的计算器的 AHK 脚本不再工作
#c::
if not WinExist("Calculator")
{
Run calc.exe
WinWait Calculator
}
WinActivate Calculator
我尝试了来自How to get window handle by PID in autohotkey?的提示
但我没有得到有效的类 id,这是我的脚本,添加了一些调试:
#c::
DetectHiddenWindows, on
Process, Exist, Calculator.exe
cpid := ErrorLevel
WinGetClass, ClassID, ahk_pid %cpid%
WinGetTitle, Title, ahk_pid %cpid%
exist := WinExist("ahk_exe Calculator.exe")
active := WinActive("ahk_exe Calculator.exe")
MsgBox look for [%cpid%] [%Title%] [%ClassID%] [%exist%] [%active%] ; cpid is the only valid variable
if not WinExist("Calculator")
{
Run calc.exe
WinWait Calculator
}
WinActivate Calculator
【问题讨论】:
标签: autohotkey