一键呼叫隐藏微信(热键Capslock+w),未启动微信则直接启动
2025-8-14 适配新版微信,新版本微信请用这个脚本。
;功能:一键呼叫隐藏微信(热键Capslock+w),未启动微信则直接启动
;作者:sunwind
;时间:2018年12月10日
;2025-08-14 适配新版微信
;最新版网址:https://blog.youkuaiyun.com/liuyukuan/article/details/84936976
#SingleInstance,force
wxhwnd:=0
CapsLock & w::
WeChat:="ahk_class Qt51514QWindowIcon"
WeChat_path:="C:\Program Files\Tencent\Weixin\Weixin.exe"
if ProcessExist("Weixin.exe")=0
Run, %WeChat_path%
else
{
if (wxhwnd=0)
WinGet,wxhwnd,ID,%WeChat%
if WinExist(WeChat)
winhide % "ahk_id " wxhwnd
else
winshow % "ahk_id " wxhwnd
}
return
ProcessExist(exe){ ;一个自定义函数,根据自定义函数的返回值作为#if成立依据原GetPID
Process, Exist,% exe
return ErrorLevel
}
老版本微信请用以下旧脚本:
;功能:一键呼叫隐藏微信(热键Capslock+w),未启动微信则直接启动
;作者:sunwind
;时间:2018年12月10日
;最新版网址:https://blog.youkuaiyun.com/liuyukuan/article/details/84936976
#SingleInstance,force
CapsLock & w::
WeChat:="ahk_class WeChatMainWndForPC"
WeChat_path:="C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"
if ProcessExist("WeChat.exe")=0
Run, %WeChat_path%
else
{
WinGet,wxhwnd,ID,%WeChat%
if strlen(wxhwnd)=0
{
winshow,%WeChat%
winactivate,%WeChat%
}
else
{
winhide,%WeChat%
}
}
return
ProcessExist(exe){ ;一个自定义函数,根据自定义函数的返回值作为#if成立依据原GetPID
Process, Exist,% exe
return ErrorLevel
}