Last active
December 20, 2021 14:14
-
-
Save hetima/ad0eacfdc68cc78a2fc1d507d8bea43e to your computer and use it in GitHub Desktop.
マウスポインタの場所にあるウィンドウを前面に持ってくるahk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; マウスポインタの場所にあるウィンドウを前面に持ってくる | |
selectWindowUnderMouse(){ | |
MouseGetPos,x,y,hwnd | |
WinGetClass win_cls, ahk_id %hwnd% | |
if win_cls = WorkerW | |
{ | |
; デスクトップではエクスプローラのウィンドウを表示orサイクル | |
WinGetClass, front_win, A | |
if front_win = CabinetWClass | |
{ | |
WinActivateBottom ahk_class CabinetWClass | |
} else { | |
WinActivate ahk_class CabinetWClass | |
} | |
return True | |
} | |
else if win_cls = Shell_TrayWnd | |
{ | |
; タスクバー 何するか考え中 | |
; 前面2枚のウィンドウを交互に切り替え案 | |
Send,!{Tab} | |
return True | |
} | |
IfWinActive, ahk_id %hwnd% | |
{ | |
return False | |
} | |
WinActivate ahk_id %hwnd% | |
return True | |
} | |
; ホイールを回すとウィンドウ切り替え | |
~WheelUp:: | |
selectWindowUnderMouse() | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment