Jump to content

Get the curosor info inside a foreing window


Recommended Posts

Hello everyone! Is there a function in autoit to get the mouse info inside a foreign window? Like for example WinGetMouseInfo('Utitled - Notepad'). There is only the GuiGetCursorInfo() function but it only gets the infomation of the cursor inside of a Window created inside an AutoIt Script using  GUICreate and MouseGetPos to find the mouse info inside the desktop. Thanks!


Link to comment
Share on other sites

Not in a single function, but you can easily create your own. With GuiGetCursorInfo you get:

$aArray[0] = X coord (horizontal)
$aArray[1] = Y coord (vertical)
$aArray[2] = Primary down (1 if pressed, 0 if not pressed)
$aArray[3] = Secondary down (1 if pressed, 0 if not pressed)
$aArray[4] = ID of the control that the mouse cursor is hovering over (or 0 if none)

Use MouseGetPos for x/y coord with the appropriate Opt("MouseCoordMode", x)

Use _IsPressed to see if mouse down on prim and sec

Use _WinAPI_WindowFromPoint to get handle of the control based on position

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...