Jump to content
Gordi300

Some help with ControlClick please!

Recommended Posts

Hey everyone!! 

I'm trying to make a program in VB.NET that click inside a picturebox of an app without moving the mouse (using ControlClick).

My code is this:

1) ControlClick("Form1", "", "[CLASS:PictureBox; INSTANCE:12]", "left", 1, 5, 5)

2) ControlClick("Form1", "", "[CLASS:PictureBox; INSTANCE:1]", "left", 1, 5, 5)

The code is correct  but the problem is that 1) works perfectly and 2) doesn't work. 

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Here I leave you the summary of each picturebox:

>>>> Window <<<<
Title:    Form1
Class:    Form
Position:    168, 0
Size:    1030, 780
Style:    0x16CA0000
ExStyle:    0x00040100
Handle:    0x00000000000B0092

 

>>>> Control <<<<                PICTUREBOX 12
Class:    PictureBox
Instance:    12
ClassnameNN:    PictureBox12
Name:    
Advanced (Class):    [CLASS:PictureBox; INSTANCE:12]
ID:    28
Text:    
Position:    305, 721
Size:    40, 40
Style:    0x56010000
ExStyle:    0x00000004
Handle:    0x0000000000040520

 

>>>> Control <<<<                PICTUREBOX 1
Class:    PictureBox
Instance:    1
ClassnameNN:    PictureBox1
Name:    
Advanced (Class):    [CLASS:PictureBox; INSTANCE:1]
ID:    4
Text:    
Position:    4, 176
Size:    700, 533
Style:    0x56010000
ExStyle:    0x00000004
Handle:    0x00000000000E02BE

 

Thank you for you help!!!

Edited by Gordi300

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

  • 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 basictheprogram
      #include <Constants.au3> Func Install()    ConsoleWrite("Install EasyLog" & @LF)    Local $handle = WinWaitActive("EasyLog USB Device Driver Installer")    ConsoleWrite("Install EasyLog2 " & $handle & @LF)    Local $blah = ControlClick($handle, "", "[CLASS:Button; INSTANCE:1]", "Left", 1)    ConsoleWrite("Install EasyLog3 " & $blah & @LF)    WinClose($handle) EndFunc Install() ConsoleWrite("End of Install!" & @LF) Trying to get AutoIt to click "Install" on the EasyLogUSB Device Driver Installer window.
      Console displays:
      Install EasyLog
      Install EasyLog2 0x001B041E
      Install EasyLog3 1
      End of Install!
      Windows Info confirms the Handle is 0x001B041E

      Window Info for the Control

      For the life of me I cannot figure out why the script is not working. 
      Even $blah says the ControlClick succeeded.
      I've tried Send("{ENTER}") and MouseClick() those didn't work either.
      Any help would be appreciated.
      Thanks.
    • By AutoPM
      #RequireAdmin AutoItSetOption('MouseCoordMode', 0) If WinExists("newtitle") Then ControlClick('newtitle', '', 'Button1') EndIf a Simple script to click Button on GUI with title "newtitle". this script is working fine on my laptop on [windows 10, windows 7]
      but on a different laptop. script is not clicking this button, is there any alternative to control click then please tell. don't want to use mouseclick 
       
      Thank you
    • By tentacole
      Afternoon!
      This is my first post, so I apologize if this is in the wrong place. 
      I've created a while loop to click in a certain area of an application, and have the y axis change at the end of each loop. My loop continues to click at x:27, x:10, even though the $y is adding 15 at the end of each loop. I did a Send($x) and Send($y) into a Notepad to see if the $y had changed after each loop, and the 15 was being added to $y each loop. (If this makes sense)
       
      I'm unsure where I'm going wrong, and would be extremely grateful if someone can point me in the correct direction to fix this. 
      Local $rDirectory = "H:\oDemandProject\fList.txt" Local $rLine = _FileCountLines($rDirectory) Local $x = 27 Local $y = 10 While $rline > 0 WinActivate("OnDemand", "-> 1") WinWaitActive("OnDemand", "-> 1") ControlClick("OnDemand", "", "[CLASS:AfxFrameOrView120u; INSTANCE:1]", "left", 4, $x, $y) $y += 15 $rLine -= 1 WEnd  
×
×
  • Create New...