请教大家:menu能否在不同软件显示不同的内容呢? Topic is solved

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

AAHKUser
Posts: 21
Joined: 19 Jun 2020, 04:31

请教大家:menu能否在不同软件显示不同的内容呢?  Topic is solved

03 Jan 2022, 10:08

大家好,我又有问题了,我在写一个类似于定制化右键菜单的小脚本,目前想实现的一个功能是能够根据当前所在的软件不同而显示不同的菜单,尝试了几种方式都没能成功,也没有查到相关的信息,似乎是一个非常小众的用法?所有又来求助于各位,非常感谢!

Code: Select all

if WinActive("ahk_exe chrome.exe") {
	
	Selection1 = 🎩Home
	Func1 = HomeKey
	}
else{
	Selection1 = end
	Func1 = endkey
	}

Menu, MyMenu, Add, %Selection1%, %Func1%
;Menu, MyMenu, Add, 🎩Home, HomeKey
Menu, MyMenu, Add, 截图!a, ScreenShot
Menu, MyMenu, Add, OCR+!a, Ocr
Menu, MyMenu, Add  ; 添加分隔线.
Menu, MyMenu, Add, 纯文本/路径复制^!c, PureText
return

HomeKey:
send, {Home}
return

EndKey:
send, {End}
return
……

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 3 guests