Jump to content
Sign in to follow this  
VAG

Control Button with random instance

Recommended Posts

VAG

I'm having some difficulty in controlling certain GUI button on my in-house application. I'm automating some clicking and read back of status from this button. I am able to ControlClick with it by providing the correct ClassnameNN from AU3Info. However, I noticed my in-house application keeps changing the INSTANCE of the same button. The TEXT of the button remains the same but INSTANCE show a different number every time the application is re-launched.

I was thinking of using WinList and WinGetState to scan through all the buttons in the application to try find out the correct INSTANCE but it returns nothing.

Is there any method to solve this issue?

Func LC3_CrystalVoice_FX($mode)
   WinActivate("Audio Console")
   Local $ButtonTxt = ControlGetText("Audio Console", "", "Button32")
   If $mode = True And $ButtonTxt = "Turn on FX" Then
      ControlClick("Audio Console", "", "Button32")
   ElseIf $mode = False And $ButtonTxt = "Turn on FX" Then
      ;Do Nothing
   ElseIf $mode = True And $ButtonTxt = "Turn off FX" Then
      ;Do Nothing
   ElseIf $mode = False And $ButtonTxt = "Turn off FX" Then
      ControlClick("Audio Console", "", "Button32")
   Else
      MsgBox(48, "CrystalVoice_FX", "Invalid ControlID, please restart application")
      Exit
   EndIf
EndFunc

AU3Info for the same button:

>>>> Control <<<<
Class:  Button
Instance:   35
ClassnameNN:    Button35
Name:   
Advanced (Class):   [CLASS:Button; INSTANCE:35]
ID: 1000
Text:   Turn on FX
Position:   718, 166
Size:   154, 25
ControlClick Coords:    41, 8
Style:  0x5001010B
ExStyle:    0x00000004
Handle: 0x00000000001204F6
>>>> Control <<<<
Class: Button
Instance: 32
ClassnameNN: Button32
Name:
Advanced (Class): [CLASS:Button; INSTANCE:32]
ID: 1000
Text: Turn on FX
Position: 718, 166
Size: 154, 25
ControlClick Coords: 41, 8
Style: 0x5001010B
ExStyle: 0x00000004
Handle: 0x00000000001A034C

 

 

Share this post


Link to post
Share on other sites
junkew

ControlClick("Audio Console", "", "[iD:1000]")

  • ID - The internal control ID. The Control ID is the internal numeric identifier that windows gives to each control. It is generally the best method of identifying controls. In addition to the AutoIt Window Info Tool, other applications such as screenreaders for the blind and Microsoft tools/APIs may allow you to get this Control ID

see http://www.autoitscript.com/autoit3/docs/intro/controls.htm

Edited by junkew

Share this post


Link to post
Share on other sites
VAG

Thanks Junkew, I tried the ID method but it still can't do the clicking. So I use the AU3Info to search for the [iD:1000] on the In-house application GUI , there I found another button using the same [iD:1000] again.

Since I know the ID, I tried to use the ControlGetHandle to return a handle string. There is a valid string shown but it don't belong to both buttons which I found on the GUI !? :blink:

I did tried ControlGetText again with this ID, but it also return empty value.

So is there other method or the only way is through imagesearch udf? 

Share this post


Link to post
Share on other sites
jdelaney

run this for your window (pass in a handle)...might clue us in on how to target it...post back console output:

#include <WinAPI.au3>
$hwnd = WinGetHandle("AutoIt Help")
Var_GetAllWindowsControls($hwnd)
Exit
Func Var_GetAllWindowsControls($hCallersWindow)
;~  $giSubFunctionCounter += 1
    ; Get all list of controls
    $sClassList = WinGetClassList($hCallersWindow)

    ; Create array
    $aClassList = StringSplit($sClassList, @CRLF, 2)

    ; Sort array
    _ArraySort($aClassList)
    _ArrayDelete($aClassList, 0)

    ; Loop
    $iCurrentClass = ""
    $iCurrentCount = 1
    $iTotalCounter = 1

    For $i = 0 To UBound($aClassList) - 1
        If $aClassList[$i] = $iCurrentClass Then
            $iCurrentCount += 1
        Else
            $iCurrentClass = $aClassList[$i]
            $iCurrentCount = 1
        EndIf

        $hControl = ControlGetHandle($hCallersWindow, "", "[CLASSNN:" & $iCurrentClass & $iCurrentCount & "]")
        $text = StringRegExpReplace(ControlGetText($hCallersWindow, "", $hControl), "[\n\r]", "{@CRLF}")
        $aPos = ControlGetPos($hCallersWindow, "", $hControl)
        $bVisible = ControlCommand($hCallersWindow, "", $hControl, "IsVisible")
        $bEnabled = ControlCommand($hCallersWindow, "", $hControl, "IsEnabled")
        $sControlID = _WinAPI_GetDlgCtrlID($hControl)
        If IsArray($aPos) Then
            ConsoleWrite("Func=[Var_GetAllWindowsControls]: ControlCounter=[" & StringFormat("%3s", $iTotalCounter) & "] ControlID=[" & StringFormat("%5s", $sControlID) & "] Handle=[" & StringFormat("%10s", $hControl) & "] ClassNN=[" & StringFormat("%19s", $iCurrentClass & $iCurrentCount) & "] XPos=[" & StringFormat("%4s", $aPos[0]) & "] YPos=[" & StringFormat("%4s", $aPos[1]) & "] Width=[" & StringFormat("%4s", $aPos[2]) & "] Height=[" & StringFormat("%4s", $aPos[3]) & "] isVisible=[" & $bVisible & "] isEnabled=[" & $bEnabled & "] Text=[" & $text & "]." & @CRLF)
        EndIf
        If Not WinExists($hCallersWindow) Then ExitLoop
        $iTotalCounter += 1
    Next
;~  $giSubFunctionCounter -= 1
EndFunc   ;==>Var_GetAllWindowsControls

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
MHz

The TEXT is the same as you mention so you can try that.

Example with a Gui to test on.

GUICreate('test', 300, 150)
$b = GUICtrlCreateButton('Turn on FX', 10, 10) ; issue button
$t = GUICtrlCreateButton('Click Me', 10, 50) ; automation
GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
        Case $b
            If GUICtrlRead($b) = 'Turn on FX' Then
                GUICtrlSetData($b, 'Turn off FX')
            Else
                GUICtrlSetData($b, 'Turn on FX')
            EndIf
        Case $t
            If ControlGetText('test', '', 'Turn on FX') Then
                ControlClick('test', '', 'Turn on FX')
            Else
                ControlClick('test', '', 'Turn off FX')
            EndIf
    EndSwitch   
WEnd

The "Click me" button does the automation on the "Turn o* FX" button. :)

Share this post


Link to post
Share on other sites
VAG

 

run this for your window (pass in a handle)...might clue us in on how to target it...post back console output:

 

Here is the console output, I found a few [iD:1000] and one of it seems to be the correct button ControlCounter =[ 44].

So how may I made a filter to grab this out?

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\XPS15\Desktop\prob.au3"
Func=[Var_GetAllWindowsControls]: ControlCounter=[  1] ControlID=[    0] Handle=[0x000A02A4] ClassNN=[            #327701] XPos=[ 674] YPos=[  26] Width=[ 246] Height=[ 666] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[  2] ControlID=[    0] Handle=[0x000A02A0] ClassNN=[            #327702] XPos=[ 674] YPos=[  26] Width=[ 246] Height=[ 515] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[  3] ControlID=[    0] Handle=[0x000B05AE] ClassNN=[            #327703] XPos=[ 684] YPos=[ 151] Width=[ 226] Height=[ 536] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[  4] ControlID=[    0] Handle=[0x001D03B4] ClassNN=[            #327704] XPos=[ 684] YPos=[ 151] Width=[ 226] Height=[ 536] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[  5] ControlID=[    0] Handle=[0x001706A0] ClassNN=[            #327705] XPos=[ 684] YPos=[ 151] Width=[ 226] Height=[ 536] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[  6] ControlID=[    0] Handle=[0x0029038E] ClassNN=[            #327706] XPos=[ 684] YPos=[ 151] Width=[ 226] Height=[ 536] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[  7] ControlID=[    0] Handle=[0x001204BE] ClassNN=[            #327707] XPos=[   8] YPos=[  26] Width=[ 620] Height=[ 666] isVisible=[1] isEnabled=[1] Text=[{4C37CA32-FE05-4fad-B181-E9B278A58559}].
Func=[Var_GetAllWindowsControls]: ControlCounter=[  8] ControlID=[    0] Handle=[0x000702EA] ClassNN=[            #327708] XPos=[   8] YPos=[  27] Width=[ 620] Height=[ 540] isVisible=[1] isEnabled=[1] Text=[{D5EB2D64-2887-455d-9CF2-D0715E41068E}].
Func=[Var_GetAllWindowsControls]: ControlCounter=[  9] ControlID=[    0] Handle=[0x000703AE] ClassNN=[            #327709] XPos=[   8] YPos=[ 574] Width=[ 620] Height=[ 118] isVisible=[1] isEnabled=[1] Text=[{FA4F201C-C608-43e1-B3D1-5B39141989F5}].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 10] ControlID=[ 1005] Handle=[0x000702BA] ClassNN=[    Afx:06860000:01] XPos=[ 694] YPos=[ 286] Width=[ 198] Height=[ 351] isVisible=[1] isEnabled=[1] Text=[SkinScrollBarFrame].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 11] ControlID=[  200] Handle=[0x000F0362] ClassNN=[         AfxWnd90u1] XPos=[ 694] YPos=[ 286] Width=[ 183] Height=[ 351] isVisible=[1] isEnabled=[1] Text=[LIMIT].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 12] ControlID=[ 1060] Handle=[0x000A0778] ClassNN=[         AfxWnd90u2] XPos=[  33] YPos=[ 577] Width=[ 570] Height=[  80] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 13] ControlID=[ 1070] Handle=[0x000D06F0] ClassNN=[         AfxWnd90u3] XPos=[  33] YPos=[ 577] Width=[ 570] Height=[  80] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 14] ControlID=[ 1003] Handle=[0x000A02A2] ClassNN=[            Button1] XPos=[ 637] YPos=[ 296] Width=[  27] Height=[ 128] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 15] ControlID=[ 1005] Handle=[0x000A029C] ClassNN=[            Button2] XPos=[   9] YPos=[ 693] Width=[ 215] Height=[  18] isVisible=[0] isEnabled=[1] Text=[Devices].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 16] ControlID=[ 1006] Handle=[0x000A0296] ClassNN=[            Button3] XPos=[ 788] YPos=[ 693] Width=[ 115] Height=[  18] isVisible=[1] isEnabled=[1] Text=[Capture Mode].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 17] ControlID=[ 1007] Handle=[0x000A0298] ClassNN=[            Button4] XPos=[ 810] YPos=[   2] Width=[  24] Height=[  24] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 18] ControlID=[ 1008] Handle=[0x000A0292] ClassNN=[            Button5] XPos=[ 840] YPos=[   2] Width=[  24] Height=[  24] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 19] ControlID=[ 1009] Handle=[0x000A0294] ClassNN=[            Button6] XPos=[ 900] YPos=[   2] Width=[  24] Height=[  24] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 20] ControlID=[ 1015] Handle=[0x000A0290] ClassNN=[            Button7] XPos=[ 488] YPos=[ 693] Width=[ 115] Height=[  18] isVisible=[1] isEnabled=[1] Text=[www.mylivecam.com].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 21] ControlID=[ 1013] Handle=[0x000A02A8] ClassNN=[            Button8] XPos=[ 870] YPos=[   2] Width=[  24] Height=[  24] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 22] ControlID=[ 1017] Handle=[0x000A02AA] ClassNN=[            Button9] XPos=[   9] YPos=[ 693] Width=[ 115] Height=[  18] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 23] ControlID=[ 1018] Handle=[0x000A02CC] ClassNN=[           Button10] XPos=[   9] YPos=[   6] Width=[  20] Height=[  20] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 24] ControlID=[ 1002] Handle=[0x00080474] ClassNN=[           Button11] XPos=[ 677] YPos=[  29] Width=[ 120] Height=[  38] isVisible=[1] isEnabled=[1] Text=[Effects].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 25] ControlID=[ 1003] Handle=[0x000C028E] ClassNN=[           Button12] XPos=[ 796] YPos=[  29] Width=[ 121] Height=[  38] isVisible=[1] isEnabled=[1] Text=[Settings].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 26] ControlID=[   11] Handle=[0x000702AC] ClassNN=[           Button13] XPos=[ 682] YPos=[  66] Width=[  32] Height=[  32] isVisible=[0] isEnabled=[1] Text=[L].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 27] ControlID=[   12] Handle=[0x000702B8] ClassNN=[           Button14] XPos=[ 682] YPos=[  66] Width=[  32] Height=[  32] isVisible=[0] isEnabled=[1] Text=[R].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 28] ControlID=[   13] Handle=[0x000702B2] ClassNN=[           Button15] XPos=[ 898] YPos=[  76] Width=[  16] Height=[  32] isVisible=[1] isEnabled=[1] Text=[More].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 29] ControlID=[ 2512] Handle=[0x0008045A] ClassNN=[           Button16] XPos=[ 695] YPos=[  71] Width=[  50] Height=[  43] isVisible=[1] isEnabled=[1] Text=[Visual Effects].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 30] ControlID=[ 2514] Handle=[0x000803E2] ClassNN=[           Button17] XPos=[ 746] YPos=[  71] Width=[  50] Height=[  43] isVisible=[1] isEnabled=[1] Text=[Avatar Effects].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 31] ControlID=[ 2515] Handle=[0x000D06DA] ClassNN=[           Button18] XPos=[ 797] YPos=[  71] Width=[  50] Height=[  43] isVisible=[1] isEnabled=[1] Text=[Media Show].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 32] ControlID=[ 2517] Handle=[0x00080490] ClassNN=[           Button19] XPos=[ 848] YPos=[  71] Width=[  50] Height=[  43] isVisible=[0] isEnabled=[1] Text=[Desktop Share].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 33] ControlID=[ 2513] Handle=[0x0008044E] ClassNN=[           Button20] XPos=[ 848] YPos=[  71] Width=[  50] Height=[  43] isVisible=[1] isEnabled=[1] Text=[CrystalVoice™ FX].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 34] ControlID=[   11] Handle=[0x000702C0] ClassNN=[           Button21] XPos=[ 682] YPos=[  69] Width=[  32] Height=[  32] isVisible=[0] isEnabled=[1] Text=[L].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 35] ControlID=[   12] Handle=[0x000702D0] ClassNN=[           Button22] XPos=[ 682] YPos=[  69] Width=[  32] Height=[  32] isVisible=[0] isEnabled=[1] Text=[R].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 36] ControlID=[   13] Handle=[0x000702D6] ClassNN=[           Button23] XPos=[ 898] YPos=[  79] Width=[  16] Height=[  32] isVisible=[0] isEnabled=[1] Text=[More].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 37] ControlID=[ 2263] Handle=[0x00080462] ClassNN=[           Button24] XPos=[ 695] YPos=[  74] Width=[  50] Height=[  43] isVisible=[0] isEnabled=[1] Text=[Picture Control].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 38] ControlID=[ 2264] Handle=[0x000702E8] ClassNN=[           Button25] XPos=[ 746] YPos=[  74] Width=[  50] Height=[  43] isVisible=[0] isEnabled=[1] Text=[View Control].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 39] ControlID=[ 2256] Handle=[0x000702E6] ClassNN=[           Button26] XPos=[ 797] YPos=[  74] Width=[  50] Height=[  43] isVisible=[0] isEnabled=[1] Text=[Auto Tuning].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 40] ControlID=[ 2262] Handle=[0x0008046C] ClassNN=[           Button27] XPos=[ 848] YPos=[  74] Width=[  50] Height=[  43] isVisible=[0] isEnabled=[1] Text=[CrystalVoice™ Noise Reduction].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 41] ControlID=[ 2267] Handle=[0x000702C4] ClassNN=[           Button28] XPos=[ 848] YPos=[  74] Width=[  50] Height=[  43] isVisible=[0] isEnabled=[1] Text=[CrystalVoice™ Focus].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 42] ControlID=[ 2268] Handle=[0x000702C6] ClassNN=[           Button29] XPos=[ 848] YPos=[  74] Width=[  50] Height=[  43] isVisible=[0] isEnabled=[1] Text=[Parental Control].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 43] ControlID=[20002] Handle=[0x000904A0] ClassNN=[           Button30] XPos=[ 709] YPos=[  41] Width=[ 184] Height=[  25] isVisible=[0] isEnabled=[1] Text=[Enable Parental Control].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 44] ControlID=[ 1000] Handle=[0x0009049C] ClassNN=[           Button31] XPos=[ 719] YPos=[ 166] Width=[ 154] Height=[  25] isVisible=[1] isEnabled=[1] Text=[Turn off FX].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 45] ControlID=[ 1000] Handle=[0x001706B6] ClassNN=[           Button32] XPos=[ 744] YPos=[ 351] Width=[ 106] Height=[  22] isVisible=[0] isEnabled=[0] Text=[Share].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 46] ControlID=[ 1002] Handle=[0x0015069E] ClassNN=[           Button33] XPos=[ 694] YPos=[ 301] Width=[ 200] Height=[  25] isVisible=[0] isEnabled=[0] Text=[Show Original Video].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 47] ControlID=[ 1004] Handle=[0x0015070A] ClassNN=[           Button34] XPos=[ 694] YPos=[ 161] Width=[ 200] Height=[  25] isVisible=[0] isEnabled=[0] Text=[Entire Desktop].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 48] ControlID=[ 1007] Handle=[0x00190606] ClassNN=[           Button35] XPos=[ 694] YPos=[ 201] Width=[ 200] Height=[  25] isVisible=[0] isEnabled=[0] Text=[Custom Area].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 49] ControlID=[ 1014] Handle=[0x00180564] ClassNN=[           Button36] XPos=[ 714] YPos=[ 241] Width=[ 185] Height=[  40] isVisible=[0] isEnabled=[0] Text=[Synchronize movement of the custom area with your cursor].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 50] ControlID=[ 1000] Handle=[0x00160604] ClassNN=[           Button37] XPos=[ 719] YPos=[ 166] Width=[ 154] Height=[  25] isVisible=[0] isEnabled=[0] Text=[Turn off Focus].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 51] ControlID=[ 1000] Handle=[0x0026024C] ClassNN=[           Button38] XPos=[ 719] YPos=[ 166] Width=[ 190] Height=[  25] isVisible=[0] isEnabled=[0] Text=[Turn off Noise Reduction].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 52] ControlID=[ 3001] Handle=[0x000D020C] ClassNN=[           Button39] XPos=[ 694] YPos=[ 271] Width=[ 215] Height=[  25] isVisible=[0] isEnabled=[1] Text=[Directional].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 53] ControlID=[ 3002] Handle=[0x0024021A] ClassNN=[           Button40] XPos=[ 694] YPos=[ 301] Width=[ 215] Height=[  25] isVisible=[0] isEnabled=[1] Text=[Non-directional].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 54] ControlID=[ 1008] Handle=[0x00090532] ClassNN=[           Button41] XPos=[ 268] YPos=[ 533] Width=[  72] Height=[  32] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 55] ControlID=[ 1009] Handle=[0x000702BC] ClassNN=[           Button42] XPos=[ 340] YPos=[ 533] Width=[  29] Height=[  32] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 56] ControlID=[ 1003] Handle=[0x001004B2] ClassNN=[           Button43] XPos=[  11] YPos=[  30] Width=[ 170] Height=[  38] isVisible=[1] isEnabled=[1] Text=[Snap Photos].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 57] ControlID=[ 1004] Handle=[0x0008046E] ClassNN=[           Button44] XPos=[ 180] YPos=[  30] Width=[ 170] Height=[  38] isVisible=[1] isEnabled=[1] Text=[Record Videos].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 58] ControlID=[ 1072] Handle=[0x00080472] ClassNN=[           Button45] XPos=[ 599] YPos=[ 534] Width=[  20] Height=[  30] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 59] ControlID=[ 1073] Handle=[0x001C04C4] ClassNN=[           Button46] XPos=[ 563] YPos=[ 534] Width=[  36] Height=[  30] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 60] ControlID=[ 1000] Handle=[0x00080494] ClassNN=[           Button47] XPos=[ 505] YPos=[ 661] Width=[  91] Height=[  27] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 61] ControlID=[ 1001] Handle=[0x0011060A] ClassNN=[           Button48] XPos=[ 595] YPos=[ 661] Width=[  25] Height=[  27] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 62] ControlID=[ 1002] Handle=[0x000E065E] ClassNN=[           Button49] XPos=[ 460] YPos=[ 661] Width=[  35] Height=[  27] isVisible=[1] isEnabled=[0] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 63] ControlID=[ 1008] Handle=[0x000C05D6] ClassNN=[           Button50] XPos=[ 366] YPos=[ 661] Width=[  35] Height=[  27] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 64] ControlID=[ 1006] Handle=[0x0012065A] ClassNN=[           Button51] XPos=[ 411] YPos=[ 661] Width=[  39] Height=[  27] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 65] ControlID=[ 1022] Handle=[0x000904AE] ClassNN=[           Button52] XPos=[  12] YPos=[ 584] Width=[  20] Height=[  66] isVisible=[1] isEnabled=[0] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 66] ControlID=[ 1023] Handle=[0x0008048E] ClassNN=[           Button53] XPos=[ 604] YPos=[ 584] Width=[  20] Height=[  66] isVisible=[1] isEnabled=[0] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 67] ControlID=[ 1009] Handle=[0x0009049A] ClassNN=[           Button54] XPos=[ 208] YPos=[ 724] Width=[  27] Height=[  23] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 68] ControlID=[ 1035] Handle=[0x0008051E] ClassNN=[           Button55] XPos=[  61] YPos=[ 661] Width=[  39] Height=[  27] isVisible=[0] isEnabled=[0] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 69] ControlID=[ 1036] Handle=[0x001803AC] ClassNN=[           Button56] XPos=[ 239] YPos=[ 724] Width=[  27] Height=[  23] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 70] ControlID=[ 1037] Handle=[0x002B0226] ClassNN=[           Button57] XPos=[  16] YPos=[ 661] Width=[  35] Height=[  27] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 71] ControlID=[ 1049] Handle=[0x0009057E] ClassNN=[           Button58] XPos=[ 302] YPos=[ 724] Width=[  27] Height=[  23] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 72] ControlID=[ 1050] Handle=[0x000D06AE] ClassNN=[           Button59] XPos=[ 334] YPos=[ 724] Width=[  27] Height=[  23] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 73] ControlID=[ 1051] Handle=[0x0008058C] ClassNN=[           Button60] XPos=[ 365] YPos=[ 724] Width=[  27] Height=[  23] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 74] ControlID=[ 1052] Handle=[0x000B06B4] ClassNN=[           Button61] XPos=[ 397] YPos=[ 724] Width=[  27] Height=[  23] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 75] ControlID=[ 1006] Handle=[0x00080488] ClassNN=[          ComboBox1] XPos=[ 694] YPos=[ 226] Width=[ 197] Height=[  30] isVisible=[1] isEnabled=[1] Text=[Microphone Array (Creative Senz3D VF0780)].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 76] ControlID=[ 1006] Handle=[0x001606D2] ClassNN=[          ComboBox2] XPos=[ 694] YPos=[ 226] Width=[ 205] Height=[  21] isVisible=[0] isEnabled=[0] Text=[Microphone Array (Creative Senz3D VF0780)].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 77] ControlID=[ 1006] Handle=[0x0024038C] ClassNN=[          ComboBox3] XPos=[ 694] YPos=[ 226] Width=[ 215] Height=[  30] isVisible=[0] isEnabled=[0] Text=[Microphone Array (Creative Senz3D VF0780)].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 78] ControlID=[  100] Handle=[0x000703C4] ClassNN=[HKComboBoxCover_Class1] XPos=[ 694] YPos=[ 226] Width=[ 197] Height=[  30] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 79] ControlID=[  100] Handle=[0x0008048C] ClassNN=[HKComboBoxCover_Class2] XPos=[ 694] YPos=[ 226] Width=[ 205] Height=[  21] isVisible=[0] isEnabled=[0] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 80] ControlID=[  100] Handle=[0x0016032E] ClassNN=[HKComboBoxCover_Class3] XPos=[ 694] YPos=[ 226] Width=[ 215] Height=[  30] isVisible=[0] isEnabled=[0] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 81] ControlID=[ 1005] Handle=[0x00080496] ClassNN=[           ListBox1] XPos=[ 694] YPos=[ 286] Width=[ 198] Height=[ 351] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 82] ControlID=[  100] Handle=[0x001C0542] ClassNN=[         ScrollBar1] XPos=[ 694] YPos=[ 286] Width=[   0] Height=[  15] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 83] ControlID=[  101] Handle=[0x00080450] ClassNN=[         ScrollBar2] XPos=[ 877] YPos=[ 286] Width=[  15] Height=[ 351] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 84] ControlID=[ 1000] Handle=[0x000802C8] ClassNN=[            Static1] XPos=[  11] YPos=[  44] Width=[ 564] Height=[ 629] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 85] ControlID=[ 1001] Handle=[0x000C05EA] ClassNN=[            Static2] XPos=[ 596] YPos=[  42] Width=[ 306] Height=[ 629] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 86] ControlID=[ 1004] Handle=[0x000A029A] ClassNN=[            Static3] XPos=[  13] YPos=[ 697] Width=[ 202] Height=[  16] isVisible=[1] isEnabled=[1] Text=[Creative Senz3D VF0780].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 87] ControlID=[ 1010] Handle=[0x000A0264] ClassNN=[            Static4] XPos=[  40] YPos=[   8] Width=[ 768] Height=[  12] isVisible=[1] isEnabled=[0] Text=[Live! Central 3].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 88] ControlID=[ 1016] Handle=[0x000A0266] ClassNN=[            Static5] XPos=[  13] YPos=[ 697] Width=[  97] Height=[  16] isVisible=[0] isEnabled=[1] Text=[Creative Senz3D...].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 89] ControlID=[ 1001] Handle=[0x000F0486] ClassNN=[            Static6] XPos=[ 691] YPos=[ 156] Width=[ 229] Height=[  50] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 90] ControlID=[ 1000] Handle=[0x0009046A] ClassNN=[            Static7] XPos=[ 684] YPos=[ 151] Width=[ 226] Height=[ 536] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 91] ControlID=[ 1004] Handle=[0x000702B6] ClassNN=[            Static8] XPos=[ 682] YPos=[ 123] Width=[ 229] Height=[  20] isVisible=[1] isEnabled=[1] Text=[CrystalVoice™ FX].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 92] ControlID=[ 1005] Handle=[0x00080498] ClassNN=[            Static9] XPos=[ 694] YPos=[ 156] Width=[ 210] Height=[  50] isVisible=[0] isEnabled=[1] Text=[Some software files are missing. Please try to reinstall the software.].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 93] ControlID=[ 1006] Handle=[0x00080444] ClassNN=[           Static10] XPos=[ 694] YPos=[ 156] Width=[ 210] Height=[ 430] isVisible=[0] isEnabled=[1] Text=[To use this feature, ensure that the video streaming format is not MJPEG.].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 94] ControlID=[65535] Handle=[0x000D0258] ClassNN=[           Static11] XPos=[ 746] YPos=[ 134] Width=[  44] Height=[  20] isVisible=[0] isEnabled=[1] Text=[Avatar Effects].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 95] ControlID=[65535] Handle=[0x000A029E] ClassNN=[           Static12] XPos=[ 746] YPos=[ 137] Width=[  44] Height=[  20] isVisible=[0] isEnabled=[1] Text=[View Control].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 96] ControlID=[20001] Handle=[0x000802DA] ClassNN=[           Static13] XPos=[ 684] YPos=[  41] Width=[  25] Height=[  25] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 97] ControlID=[ 1001] Handle=[0x000A0256] ClassNN=[           Static14] XPos=[ 694] YPos=[ 261] Width=[ 190] Height=[  23] isVisible=[1] isEnabled=[1] Text=[Effects:].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 98] ControlID=[ 1002] Handle=[0x000A04FA] ClassNN=[           Static15] XPos=[ 694] YPos=[ 201] Width=[ 190] Height=[  23] isVisible=[1] isEnabled=[1] Text=[Microphone:].
Func=[Var_GetAllWindowsControls]: ControlCounter=[ 99] ControlID=[ 1004] Handle=[0x000703A8] ClassNN=[           Static16] XPos=[ 694] YPos=[ 647] Width=[ 216] Height=[  70] isVisible=[1] isEnabled=[1] Text=[The effect will work with the selected microphone.].
Func=[Var_GetAllWindowsControls]: ControlCounter=[100] ControlID=[ 1007] Handle=[0x000702D2] ClassNN=[           Static17] XPos=[ 694] YPos=[ 166] Width=[  25] Height=[  25] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[101] ControlID=[ 1002] Handle=[0x001206B8] ClassNN=[           Static18] XPos=[ 694] YPos=[ 201] Width=[ 190] Height=[  23] isVisible=[0] isEnabled=[0] Text=[Microphone:].
Func=[Var_GetAllWindowsControls]: ControlCounter=[102] ControlID=[ 1004] Handle=[0x000E06E2] ClassNN=[           Static19] XPos=[ 694] YPos=[ 637] Width=[ 215] Height=[  40] isVisible=[0] isEnabled=[0] Text=[This feature will only work if your application has selected the above microphone.].
Func=[Var_GetAllWindowsControls]: ControlCounter=[103] ControlID=[ 1008] Handle=[0x00070588] ClassNN=[           Static20] XPos=[ 694] YPos=[ 166] Width=[  25] Height=[  25] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[104] ControlID=[ 1010] Handle=[0x000702C2] ClassNN=[           Static21] XPos=[ 694] YPos=[ 281] Width=[ 215] Height=[  75] isVisible=[0] isEnabled=[1] Text=[CrystalVoice™ Focus allows you to get clear audio with focused voice capture and noise cancellation.].
Func=[Var_GetAllWindowsControls]: ControlCounter=[105] ControlID=[ 1011] Handle=[0x00060676] ClassNN=[           Static22] XPos=[ 699] YPos=[ 371] Width=[ 190] Height=[ 165] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[106] ControlID=[ 1002] Handle=[0x0017066A] ClassNN=[           Static23] XPos=[ 694] YPos=[ 201] Width=[ 190] Height=[  23] isVisible=[0] isEnabled=[0] Text=[Microphone:].
Func=[Var_GetAllWindowsControls]: ControlCounter=[107] ControlID=[ 1004] Handle=[0x003D059A] ClassNN=[           Static24] XPos=[ 694] YPos=[ 351] Width=[ 216] Height=[  70] isVisible=[0] isEnabled=[0] Text=[This feature will only work if your application has selected the above microphone.].
Func=[Var_GetAllWindowsControls]: ControlCounter=[108] ControlID=[ 1008] Handle=[0x00370016] ClassNN=[           Static25] XPos=[ 694] YPos=[ 166] Width=[  25] Height=[  25] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[109] ControlID=[ 1005] Handle=[0x0009044A] ClassNN=[           Static26] XPos=[   8] YPos=[  27] Width=[ 620] Height=[ 540] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[110] ControlID=[ 1071] Handle=[0x00080492] ClassNN=[           Static27] XPos=[   8] YPos=[ 574] Width=[ 619] Height=[ 118] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[111] ControlID=[ 1053] Handle=[0x000804AA] ClassNN=[           Static28] XPos=[  10] YPos=[  69] Width=[ 616] Height=[ 462] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[112] ControlID=[ 1006] Handle=[0x000D0252] ClassNN=[           Static29] XPos=[  11] YPos=[ 542] Width=[ 256] Height=[  16] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[113] ControlID=[ 1078] Handle=[0x00090622] ClassNN=[           Static30] XPos=[ 193] YPos=[ 540] Width=[  18] Height=[  18] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[114] ControlID=[ 1079] Handle=[0x001B02A6] ClassNN=[           Static31] XPos=[ 218] YPos=[ 540] Width=[  18] Height=[  18] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[115] ControlID=[ 1080] Handle=[0x000B05CC] ClassNN=[           Static32] XPos=[ 243] YPos=[ 540] Width=[  18] Height=[  18] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[116] ControlID=[ 1025] Handle=[0x001004AC] ClassNN=[           Static33] XPos=[  33] YPos=[ 577] Width=[ 570] Height=[  80] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[117] ControlID=[    0] Handle=[0x000A0576] ClassNN=[       SysHeader321] XPos=[  33] YPos=[ 577] Width=[ 598] Height=[  24] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[118] ControlID=[ 1080] Handle=[0x000A051C] ClassNN=[     SysListView321] XPos=[  33] YPos=[ 577] Width=[ 570] Height=[  80] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[119] ControlID=[  100] Handle=[0x00080466] ClassNN=[ToolBarHighlight_Class1] XPos=[ 746] YPos=[  29] Width=[  50] Height=[ 125] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[120] ControlID=[  100] Handle=[0x000702AE] ClassNN=[ToolBarHighlight_Class2] XPos=[ 746] YPos=[  32] Width=[  50] Height=[ 125] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[121] ControlID=[ 2888] Handle=[0x00080448] ClassNN=[  ToolBarWnd_Class1] XPos=[ 682] YPos=[  66] Width=[ 229] Height=[  50] isVisible=[1] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[122] ControlID=[ 2889] Handle=[0x000A02CA] ClassNN=[  ToolBarWnd_Class2] XPos=[ 682] YPos=[  69] Width=[ 229] Height=[  50] isVisible=[0] isEnabled=[1] Text=[].
Func=[Var_GetAllWindowsControls]: ControlCounter=[123] ControlID=[    0] Handle=[0x00410300] ClassNN=[     VideoRenderer1] XPos=[  10] YPos=[ 127] Width=[ 616] Height=[ 346] isVisible=[1] isEnabled=[1] Text=[ActiveMovie Window].
>Exit code: 0    Time: 0.932

Share this post


Link to post
Share on other sites
VAG

Thanks MHz, I used your code. I have inserted some SLEEP before the GUICtrlRead because it will cause my In-house application to become faulty if the button string is not ready yet. As those buttons I need to control are located under a few tabs so need to navigate to it first before clicking.

Everything seems to work correctly now even the INSTANCE keeps changing. Just curious of how this works instead of polling the ClassList like Jdelaney? :geek:

Share this post


Link to post
Share on other sites
MHz

GuiCtrlRead is part the example Gui. The automation code in the example is

If ControlGetText('test', '', 'Turn on FX') Then
                ControlClick('test', '', 'Turn on FX')
            Else
                ControlClick('test', '', 'Turn off FX')
            EndIf

just to be clear on this.

Look at AutoIt -> Using AutoIt -> Controls in the help file for using advanced control handling. That may help you understand your options.

So you could probably do for example

ControlClick('Audio Console', '', '[CLASS:Button; TEXT:Turn on FX]')

so the code can work with what matches the conditions. :)

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  

×