Add A_MouseHwnd to get the window under the mouse

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

Add A_MouseHwnd to get the window under the mouse

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: 1463
Joined: 13 Aug 2016, 21:04
Contact:

Re: Separate MouseGetPos into MouseGetWin

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".

Return to “Wish List”

Who is online

Users browsing this forum: WarlordAkamu67 and 11 guests