Jump to content
lattey

ControlClick not clicking?

Recommended Posts

I used the window info tool to get what I've got below, but it just doesn't click the button. I run the script, nothing happens. 

WinActivate("SELECTION")
Sleep(200)
ControlClick("SELECTION", "", "[CLASS:Button;INSTANCE:2]")

i think maybe the autoit cannot detect the windows. So what i do:
 

MouseClick( "", 503, 500)
local $blanktitle = WinGetTitle("[ACTIVE]")
  If StringInStr($blanktitle, "SELECTION") Then
       msgbox("","", "got")
       WinActivate($blanktitle)
       ControlClick($blanktitle, "", "[CLASS:Button;INSTANCE:2]")
       
   Endif

The script can detect the windows as the it is prompt "got" message. But it just doesn't click the button.

Please help.
Thanks for any help you can offer.

Share this post


Link to post
Share on other sites

I have this same problem, but with this code:

This works fine:
MouseClick("right",1758,432,1)

This click, but not in the right place:

ControlClick($pwd, "", 0,"right", 1, 1755, 435)

Share this post


Link to post
Share on other sites

if the autoit win info tool is giving you window info then the script should be able to detect the window just fine.

maybe play with your wintitlematchmode opt to be more generic.

also instead of sleep, use winwaitactive


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah patience, how long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites

hi,

yes, the autoit info can detect the the windows. 

i ve also play with  wintitlematchmode , but have same result. 

 

 

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 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  
    • By Yirrlaar
      #Include <WinAPI.au3> local $ClassName = _WinAPI_GetClassName(WinGetHandle(WinGetTitle("[ACTIVE]"))) ControlClick(WinGetTitle("[ACTIVE]"), "", "[CLASS:"&$ClassName&"; INSTANCE:1]", "primary") When I am running this script it just gives me a ConsoleWrite output of "0x001D04A8"
      When using "AutoIT v3 Window Info" all the info I need for the ControlClick is there and displayed perfectly as if I typed it in normally.
      Upon click the button it should be clicking it, I see the following inn the console window:
      If I replace the $ClassName with the actual ClassName of "WindowsForms10.BUTTON.app.0.3296db7_r14_ad1" it works just fine, any ideas???
    • By Tats
      Hi everyone,
      I have a problem with ControlClick function. It doesn't work no matter how I tried all the possible combination of the parameters.
      Below is the scripts of possible parameter combination:
      ;ControlClick("title","text","controlID ","button","clicks","x","y") ;title= Title, Class, Handle ;controlID= Class, ClassNN, Instance ;Title here is empty when I check it with AutoIt Info ControlClick("", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Class of the window ControlClick("[ScreenKeyboard::SKFrame]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Handle of the window ControlClick("[0x000907A0]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[INSTANCE:18]", "left", "1", "230","890") Am I coding it correctly?
      Thanks
×
×
  • Create New...