Jump to content

Get mouse position


Recommended Posts

Hi guys, I'm new to this Forum and I'm very sorry if this has been asked before, but I'm asking it, because I couldn't find and answer on this. I have a Auto Login utility with my program ScreenGuard, but it has to be updated for win 8.1. Now, I want to know, how can I get the position of the mouse cursor when the user double clicks a control? Thanks in advance

Link to comment
Share on other sites

try:

#include <array.au3>
#include <Misc.au3>
While True
    If _IsPressed(01) Then
        While _IsPressed(01)
        WEnd
        $hTimer = TimerInit()
        While TimerDiff($hTimer)<500
            If _IsPressed(01) Then
                While _IsPressed(01)
                WEnd
                $a = MouseGetPos()
                _ArrayDisplay($a)
                ExitLoop
            EndIf
        WEnd
    EndIf
WEnd

Change 500 to be less time, if half a second is too slow.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

  • Moderators

$a is an Array of the x,y coords. So you would need to display both indexes, like so:

$a = MouseGetPos()
    MsgBox(0, "", "You clicked the screen at " & $a[0] & ", " & $a[1])

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
 Share

  • Recently Browsing   0 members

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