【鼠标增强】侧键激活窗口

使用方法:
按住鼠标左键,再按右键1次则记录当前窗口id,给鼠标侧键XButton1隐藏或唤醒窗口1使用
按住鼠标左键,再按右键2次则记录当前窗口id,给鼠标侧键XButton2隐藏或唤醒窗口2使用
对桌面或者任务栏,按住鼠标左键,再按右键1次或2次。则清除隐藏唤醒功能,恢复原键

 

#if GetKeyState("LButton", "P")
RButton::
if (winc_presses > 0) {
winc_presses ++
Return
} winc_presses = 1
SetTimer KeyWinC18, -400
Return

KeyWinC18:
if (winc_presses = 1) {
	MouseGetPos,,,WinID
	WinGetClass, WinClass, ahk_id %WinID%
	if (WinClass="Progman") || (WinClass="Shell_TrayWnd")
		XButton1WinID:=""
	else
		XButton1WinID:=WinID
} else if (winc_presses = 2) {
	MouseGetPos,,,WinID
	WinGetClass, WinClass, ahk_id %WinID%
	if (WinClass="Progman") || (WinClass="Shell_TrayWnd")
		XButton2WinID:=""
	else
		XButton2WinID:=WinID
} winc_presses = 0
Return
#if

*$XButton1::
if (XButton1WinID="") {
	Send {XButton1}
 } else {
	if WinActive("ahk_id "XButton1WinID) {
		WinMinimize, ahk_id %XButton1WinID%
		WinActivate, ahk_class Shell_TrayWnd
	} else {
		WinRestore, ahk_id %XButton1WinID%
		WinActivate, ahk_id %XButton1WinID%
	}
} Return

*$XButton2::
if (XButton2WinID="") {
	Send {XButton2}
 } else {
	if WinActive("ahk_id "XButton2WinID) {
		WinMinimize, ahk_id %XButton2WinID%
		WinActivate, ahk_class Shell_TrayWnd
	} else {
		WinRestore, ahk_id %XButton2WinID%
		WinActivate, ahk_id %XButton2WinID%
	}
} Return

给TA买糖
共{{data.count}}人
人已赞赏
AHKV1办公

AHK 重定向(获取)CMD命令行输出

2021-8-6 9:15:16

学习

漂亮的Acrylic亚克力·磨砂·材质窗口

2021-8-10 8:51:28

2 条回复 A文章作者 M管理员
  1. 月下马

    帅呆了!!还有这种思路!受教啦!

  2. jameshoo007

    请问*$xbutton1,前面的*$是什么意思呀

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索