Search the Community
Showing results for tags 'button Instance'.
-
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