Jump to content

Need help ControlClick. Seems to be just selecting part of the grid window and not clicking.


Recommended Posts

Hi. I am just a week-old AutoIt user and having lots of fun and also tons of problems with it including this:

I have made some scripts using auto-clicking the one part of the list. It seems that the list is in GRID. So the list indicates User1, User2, upto User10. I wanted to pick for my test the User5 and the Coords of that particular list in the window are 64, 117 (but I'm using 65, 115 which is still in range).

Here are the Autoit details that I get and used:

>>>> Control <<<<
Class:    WindowsForms10.Window.8.app.0.297b065_r61_ad1
Instance:    5
ClassnameNN:    WindowsForms10.Window.8.app.0.297b065_r61_ad15
Name:    grid_Users
Advanced (Class):    [NAME:grid_Users]
ID:    7997658
Text:    
Position:    6, 161
Size:    155, 409
ControlClick Coords:    64, 117
Style:    0x56010000
ExStyle:    0x00000200
Handle:    0x00000000007A08DA

------------------------

 

So I am using the SCRIPT seen at the bottom but it seems that the

ControlClick("[CLASS:WindowsForms10.Window.8.app.0.297b065_r61_ad1]", "","WindowsForms10.Window.8.app.0.297b065_r61_ad15", "left", 1,65,115)

is not clicking. It is just selecting. I tried to add

Send("{ENTER}") 

but it does not help at all and not clicking.

 

The SCRIPT that I make (sorry if I use Sleep more than often):

Local $_userPW = "1234AbCd"

Local $_userName = "UserMe"

If WinExists("[CLASS:WindowsForms10.Window.8.app.0.297b065_r61_ad1]") Then ; for TCP comm only
      ControlClick("[CLASS:WindowsForms10.Window.8.app.0.297b065_r61_ad1]", "","WindowsForms10.Window.8.app.0.297b065_r61_ad15", "left", 1,65,115)
      Sleep(1000)
      ControlSetText ( "Shark 250 Security Editor", "", "[CLASS:WindowsForms10.EDIT.app.0.297b065_r61_ad1; INSTANCE:5]", $_userMe)
      Sleep(700)
      ControlSetText ( "Shark 250 Security Editor", "", "[CLASS:WindowsForms10.EDIT.app.0.297b065_r61_ad1; INSTANCE:4]", $_userPW)
      Sleep(700)
      ControlSetText ( "Shark 250 Security Editor", "", "[CLASS:WindowsForms10.EDIT.app.0.297b065_r61_ad1; INSTANCE:3]", $_userPW)
      Sleep(1000)
      ;ControlClick("Shark 250 Security Editor", "", "[CLASS:WindowsForms10.BUTTON.app.0.297b065_r61_ad1; INSTANCE:7]")
      ;Sleep(2000)
      ;ControlClick("Shark 250 Security Editor", "", "[CLASS:WindowsForms10.BUTTON.app.0.297b065_r61_ad1; INSTANCE:8]" , "" )
   ElseIf WinExists("[CLASS:WindowsForms10.Window.8.app.0.297b065_r60_ad1]") Then ; for Serial comm only
      ControlClick("[CLASS:WindowsForms10.Window.8.app.0.297b065_r60_ad1]", "","WindowsForms10.Window.8.app.0.297b065_r60_ad15", "left", 1,65,115)
      Sleep(1000)
      ControlSetText ( "Shark 250 Security Editor", "", "[CLASS:WindowsForms10.EDIT.app.0.297b065_r60_ad1; INSTANCE:5]", $_userMe)
      Sleep(700)
      ControlSetText ( "Shark 250 Security Editor", "", "[CLASS:WindowsForms10.EDIT.app.0.297b065_r60_ad1; INSTANCE:4]", $_userPW)
      Sleep(700)
      ControlSetText ( "Shark 250 Security Editor", "", "[CLASS:WindowsForms10.EDIT.app.0.297b065_r60_ad1; INSTANCE:3]", $_userPW)
      Sleep(1000)
      ControlClick("Shark 250 Security Editor", "", "[CLASS:WindowsForms10.BUTTON.app.0.297b065_r60_ad1; INSTANCE:7]")
      Sleep(2000)
      ControlClick("Shark 250 Security Editor", "", "[CLASS:WindowsForms10.BUTTON.app.0.297b065_r60_ad1; INSTANCE:8]" , "" )
   Else ; for other comms like USB and optics.
      ToolTip("Other Comms Ongoing!")
      Exit
   EndIf

 

 

I tried mouseclick and it is working well in my scripts but I dont want to rely on mouseclicks because it could cause errors when the window is blocked by other apps.

Anything to give me insights to fix my problem to click the portion of the window I wanted to click and not just selecting it? 

 

Thanks very much

- Me -

Edited by It_is_me_Me
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...