Jump to content

click on button which is on Frame - (Moved)


DIMM_V2
 Share

Go to solution Solved by DIMM_V2,

Recommended Posts

Hello , can someone please help me with my code , im trying to click on "Setup" text but this is on Frame , so i dont know how to do that , thank you

my not working code :

#include <Array.au3>

Run("C:\Program Files\ESET\ESET Endpoint Antivirus\egui.exe")
Sleep(2000)
Global $hWnd = WinGetHandle("egui.exe")
Global $hWnd = WinWait('ESET Endpoint Antivirus')

If Not $hWnd Then
    MsgBox(16, "Error", "ESET Endpoint Antivirus window not found")
    Exit
EndIf

ControlClick('ESET Endpoint Antivirus','','[TEXT:Tools]')
Sleep(1000)
ControlClick('ESET Endpoint Antivirus','','[TEXT:Setup]')
ControlClick("ESET Endpoint Antivirus","", "")


; Title:    ESET Endpoint Antivirus
; Class:    ESET Main Frame

 

* For the moment my Solution is : Click on this button by Coordinates Mode , but it is not very reliable, 

And yes , autoit info tooll , can't detect that.

i want to detect this button  as text and after click on that .

>>>> Window <<<<
Title:    ESET Endpoint Antivirus
Class:    ESET Main Frame
Position:    392, 130
Size:    1024, 670
Style:    0x94070000
ExStyle:    0x00040100
Handle:    0x00000000001B0BC2

is that possible ? 

thx

thIxn.png

Link to comment
Share on other sites

  • Developers

Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Solution

ok ,Got , It , full working code .

This Clicks on: Tools , Setup, and highlight  Advanced Setup.

#include "UIAWrappers.au3"


;~ dimm 
;~ find UIA controls with simplespy.au3


; Start ESET Endpoint Antivirus
Run("C:\Program Files\ESET\ESET Endpoint Antivirus\egui.exe")
WinWait("ESET Endpoint Antivirus")
; Get ESET window object
$oEset = _UIA_getFirstObjectOfElement($UIA_oDesktop, "class:=ESET Main Frame", $treescope_children)
$oEset.setfocus()
 
;~ ToolTip("Eset")
Sleep(1000)
; Click on 'Tools' (Assuming it is a button or a clickable element)
$oToolsButton = _UIA_getObjectByFindAll($oEset, "controltype:=UIA_ButtonControlTypeId;name:=Tools", $treescope_subtree)
_UIA_action($oToolsButton, "leftclick")
$Setup_button = _UIA_getObjectByFindAll($oEset, "controltype:=UIA_ButtonControlTypeId;name:=Setup", $treescope_subtree)
;~ Sleep(1000)
_UIA_Action($Setup_button,"highlight")
;~ Sleep(2000)
_UIA_action($Setup_button, "leftclick")
;~ Sleep(1000)
;~ $test = _UIA_getObjectByFindAll($oEset, "controltype:=UIA_MenuControlType;name:=Advanced Setup", $treescope_subtree)
$test = _UIA_getObjectByFindAll($oEset, "controltype:=UIA_PaneControlTypeId,50033;name:=Advanced Setup;", $treescope_subtree); dimm keep 50033 of instance of object , or add  <> for  UIA_PaneControlTypeId
;~ WinActivate("ESET Endpoint Antivirus")
Sleep(2000)
_UIA_Action($test,"highlight") ;~  highlight my test s
;~ _UIA_action($test, "leftclick")
;~ _UIA_action($oPaneControl, "leftclick")


;~ UIA_MenuItemControlTypeId (4):
;~ Represents a menu item control.
;~ UIA_PaneControlTypeId (18):
;~ Represents a pane control.
;~ UIA_SliderControlTypeId (12):
;~ Represents a slider control.
;~ UIA_SpinnerControlTypeId (14):
;~ Represents a spinner control.
;~ UIA_TabControlTypeId (8):
;~ Represents a tab control.
;~ UIA_TextControlTypeId (21):
;~ Represents a text control.
;~ UIA_ToolBarControlTypeId (6):
;~ Represents a toolbar control.
;~ UIA_TreeControlTypeId (10):
;~ Represents a tree control.
;~ UIA_WindowControlTypeId (9):

 

Edited by DIMM_V2
Link to comment
Share on other sites

  • 2 weeks later...

Hello , im back :;-) 

i wonder if it possible to automate a custom software build like this one

* at my knowledge of today , it is possible with two methods : 1- image click with autoit , 2 - exact mouse coords , there is a 3 tr method to do this ?

as info i have only class , no info , no text even with simplespy,Control Viewer (mod 2023)

* if someone want to test with soft from the picture i have attached this exe.

log from simple spy

Mouse position is retrieved 312-498
At least we have an element [Index][TfrmMain.UnicodeClass]

Having the following values for all properties: 
Title is: <Index>    Class   := <TfrmMain.UnicodeClass>    controltype:= <UIA_WindowControlTypeId>    ,<50032>    , (0000C370)    154;130;606;468
*** Parent Information top down ***
0: Title is: <Desktop 1>    Class   := <#32769>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    0;0;1768;992
"Title:=Desktop 1;controltype:=UIA_PaneControlTypeId;class:=#32769"    


;~ *** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_setVar("Index.mainwindow","title:=Index;classname:=TfrmMain.UnicodeClass")
_UIA_action("Index.mainwindow","setfocus")



 

image.thumb.png.0b655b43dedd8719389614578233cf52.png

dimm_gui.rar

Edited by DIMM_V2
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...