Jump to content
Sign in to follow this  
Progh0st

MouseClick Issue

Recommended Posts

I have an issue with mouseclick on windows 7 64bit, it simply dosen't work. I'm trying to send mouseclick on a fullscreen window. 

What have i tried:

-  Run as admin

-  Tryed different Opt mouse coords modes and pixel as well

-  Compile it 32 and 64 bit same result, not working

 

And i ran out of ideas, does anyone know what is going on with windows 7 and mouseclicks!

Share this post


Link to post
Share on other sites

Nothing is going on, it's perfectly fine.

Post the exact code you're having trouble with.

#RequireAdmin
#include <Misc.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;#NoTrayIcon

Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)
Opt("MouseClickDelay", 0)

;MsgBox(4096, "", "")

If Not _Singleton(@Scriptname, 1) Then
    MsgBox(4096, "Is Running", "Program is already running .-.")
    Exit
EndIf
Global $searchcolor = 0xF24A17
Global $dll = DllOpen("user32.dll")

#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Clicker", 351, 86, 556, 458)
$Label1 = GUICtrlCreateLabel("Set sleep delay", 8, 8, 288, 17)
Global $Button1 = GUICtrlCreateButton("Start", 8, 56, 339, 25)
Global $Input = GUICtrlCreateInput("25", 8, 32, 337, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $Read = GUICtrlRead($Input)
            Global $Sleep = $Read
            If $Read = "" Then
                MsgBox(4096, "Error", "You cannot leave this space empty!")
                Exit
            Else
                GUIDelete($Form1)
                Call("Check")
            EndIf
    EndSwitch
WEnd


Func Check()
If WinExists("[class:46813]") Then
    Call("clicker")
Else
    MsgBox(4096, "clicker", "Waiting for app to start")
    WinWait("[class:46813]")
    Sleep(10000)
    Call("clicker")
EndIf
EndFunc

 

 

Func clicker()


While WinExists("[class:46813]") = True
$pos = MouseGetPos()
$coord = PixelSearch(($pos[0] - 100) , ($pos[1] - 100) , ($pos[0] + 100) , ($pos[1] + 100), $searchcolor)
If _IsPressed(72, $dll) Then
    Exit
EndIf
If IsArray($coord) = 1 Then
    MouseClick("Left", Default, Default, 1, 0)
    Sleep($Sleep)
EndIf
WEnd
Exit
EndFunc

Share this post


Link to post
Share on other sites

Are you expecting the mouse to move somewhere? because you have default for both x and y, meaning mouse will click at current position.

No, i don't want it to move. But i can tell you that it works fine on my sisters laptop with win 8.1 64 bit but not on win 7 64bit, i have no idea why...

Share this post


Link to post
Share on other sites

What about just. MouseClick("Left", Default, Default, 1, 0)

Does not work "MouseClick("Left", Default, Default, 1, 0)" but everything else does work, i have been testing each one.

Share this post


Link to post
Share on other sites

I suggest if you have not already, that you restart your computer because it sounds pretty odd.

Restarted Pc 1000 times, and tried on other PC's same result, i guess it can't be solved..

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • By lunarlattice
      Hi All,
      I am trying to login into our application using AutoIT. When I launch the application a splash screen appears and the login screen goes behind it. At this point the script pauses and I loose control of everything. I have literally tried everything for the past two days but nothing has worked yet. Any suggestions would be appreciated.
      RunWait("\\mchsv411.siplaceworld.net\splmshare\int00\conf\start_apps\windows\start_nx110.bat en portal_client int00 tc112", "", @SW_MAXIMIZE)
      AutoItSetOption("SendKeyDelay", 200)
      Local $hWnd = WinWaitActive("Teamcenter Login")
      MouseClick("left", @DesktopWidth / 2, @DesktopHeight / 2)
      The splash screen has title "Teamcenter" and is static.
      I tried to click on the center to get control of login window.
      I have tried WinActivate, WinSetState, ControlCommand and a lot of other things.
    • By lonardd
      Hi,
      I have a very strange problem concerning MouseClick function.
      I need to start Control Panel, navigate it on the Display Section (Adjust screen resolution link), click on it, and from the next Dialog choose Intel Graphic tool tab and navigate into it when it opens. 
      I wasn't using MouseClick() at first when I tried to use Control IDs, but I was fed up with the Autoit Window Info poor and inaccurate info (It flickers and the moment I click on the control the control ID and class disappear) so I ended up choosing the easiest way.
      The code I'm posting worked OK until two weeks ago, the mouse clicks were accurately performed and the Script reached the end with no errors...and I was happy.
      All of a sudden, between one try and the other, I noticed the cursor not flying exactly where it was supposed to, namely to the Control Panel ->Display->Adjust screen resolution link   but it clicked some 30 pixels below and some 30 pixels to the left, choosing obviously and undesired function and from that point it screwed the whole thing up. And from that moment onward, it seems I can no longer regain the mouse to click on that sequence.
      Could it be because my Control Panel ->Display form moved slightly from one test to another and therefore I got that small offside?
      If you believe this is the reason, I should then re position the Control Panel ->Display window to 0,0 and recalculate all the clicks. 
      do you have a suggestion?
       
      Thanks a lot
      Dave
       
       
       
      RotateDisplays.au3
    • By c1one
      Something simple enough, and I am sure it's an oversight, but I have not been able to track this down. The entire script is attached, but here is the point of failure.
      Note: I am getting the "Error: subscript used on non-accessible variable" but I thought the initial line of:
      AutoItSetOption('MouseCoordMode', 0)
      Should address that issue? 
      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; Install updates (minimized and updating for many minutes)
      ; Updates Not Installed Screen
         ; Wait for updates to complete
      WinWait("ProSeries Update")
         ; Wait just over 9 minutes to ensure popup is ready (test alternative to WinWait)
      Sleep(550000)
         ; Set focus on Product Licenses window
      WinActivate("ProSeries Update")
         ; Send Mouse Click to Install Now button
      MouseClick ( "left" [, 581, 362 [, clicks = 1 [, speed = 10]]] )
      ; end Installing Updates screen
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       
      Thanks for any insights!
      c1one
      ProSeries2017_No_Customer_Info.au3
    • By dadalt
      Hi!
      I have a button where I need to close it!
      I was doing through  clicking same position in screen but there are some id's that have different sizes.
      What are the possible ways to click this closable button?
      Is there a way to close it through id? Is there a way to get it's position through it's ID?  
      Thanks in advance!


    • By Miliardsto
      Hello I got this script works below and I want to do not move cursor on screen when action is performed.
      Opt("MouseCoordMode", 1) ; cause it gets whole screen coords Local $x, $y Local $search = _ImageSearch('item.bmp', 0, $x, $y, 0) If $search = 1 Then MouseMove($x, $y,0) MouseClick("right", $x, $y)) MouseMove($xMiddle, $yMiddle,0) MouseClick("left", $xMiddle, $yMiddle) EndIf I changed this above to this below and what happen is. It clicks right button and then left button but not move mouse to $x $y and then to $xMiddle $yMiddle.
      Opt("MouseCoordMode", 1) ; cause it gets whole screen coords Local $x, $y Local $search = _ImageSearch('item.bmp', 0, $x, $y, 0) If $search = 1 Then ControlClick("","",0,"secondary",1,$x,$y) ControlClick("","",0,"primary",1,$xMiddle,$yMiddle) EndIf If needed I got handle in var $hwnd
      Please tell me how parameters in ControlClick would like be
×
×
  • Create New...