Add A_MouseHwnd to get the window under the mouse

Propose new features and changes
iseahound
Posts: 1427
Joined: 13 Aug 2016, 21:04
Contact:

Add A_MouseHwnd to get the window under the mouse

Post by iseahound » 19 Sep 2022, 21:40

MouseGetWin should be its own function for direct use with #HotIf.

Code: Select all

#HotIf WinGetClass(MouseGetWin()) = "CabinetWClass"
As it stands, MouseGetPos should return the position of the mouse cursor, and while I understand the motivation of returning x, y, hwnd, and control to minimize delay, multiple return types are not implemented, so both SplitPath and MouseGetPos are troublesome when a single line is required. (Unless JS destructuring will be implemented, {hwnd} := MouseGetWin())
Current Script
Last edited by iseahound on 02 Mar 2023, 19:42, edited 2 times in total.

iseahound
Posts: 1427
Joined: 13 Aug 2016, 21:04
Contact:

Re: Separate MouseGetPos into MouseGetWin

Post by iseahound » 02 Mar 2023, 19:41

Actually, I think adding A_MouseHwnd as an alternative to A for getting the current window under the mouse would be a very useful built in variable. Considering that MouseGetPos returns 3 arguments, two of which are actually "positional".

Post Reply

Return to “Wish List”