[AHK]一键呼叫隐藏微信(热键Capslock+w),未启动微信则直接启动

一键呼叫隐藏微信(热键Capslock+w),未启动微信则直接启动

;功能:一键呼叫隐藏微信(热键Capslock+w),未启动微信则直接启动
;作者:sunwind
;时间:2018年12月10日
;最新版网址:https://blog.csdn.net/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
}

猜你喜欢

转载自blog.csdn.net/liuyukuan/article/details/84936976