Jump to content

Control is not responding anyway


Go to solution Solved by agivx3,

Recommended Posts

Hi,

i have a window with a control which doesnt react to any command. I have tried every possible autoit option like controlclick, controlsend, controlcommand and also send. I also used these commands using handles and  classes.  

Can i interact with the control with any DLLCALL´s ?

Any further ideas what i could do ?

Thanx for help

 

post-59879-0-60928300-1371200152_thumb.j

Link to comment
Share on other sites

Can you post the Control* commands you used including how you specified the ControlID?

What was the return value of the Control* commands?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If you want help, you really need to provide code, else we are just guessing what the issue may be.

It is also very handy to know what window/program you are trying to interact with.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

What I see from the screenshot he tries to automate the Windows Remote Support tool. He's using a German Windows system.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Here are some of the commands i tried. I tried much more...

#include <GuiComboBox.au3>

Run("C:\Windows\System32\msra.exe /offerRA CITRIXSERVER")
WinWait("Windows-Remoteunterstützung")
WinActivate("[CLASS:NativeHWNDHost]","")
$hWnd = ControlGetHandle ( "[CLASS:NativeHWNDHost]", "", 1054 )

;ControlFocus ( "Windows-Remoteunterstützung", "", 1054 )
;_GUICtrlComboBox_ShowDropDown($hWnd , True)

;ControlClick ( "[CLASS:NativeHWNDHost]", "","[CLASS:ComboBox; INSTANCE:1]", "left" )

;controlCommand( "Windows-Remoteunterstützung", "", 1054, "SetCurrentSelection","DOMAINUsername:SessionID" )
;controlCommand( "Windows-Remoteunterstützung", "", 1054, "SetCurrentSelection",5 )

;controlSend( $Handle,"","ComboBox1","{RIGHT}")

;controlSend("Windows-Remoteunterstützung", "", $Handle,"{RIGHT}")
;Send("{RIGHT}")

Link to comment
Share on other sites

I would add some error checking. Means: Check for each command that is has been executed successfully.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I just tried this. The error output is 0

controlCommand( "Windows-Remoteunterstützung", "", 1054, "SetCurrentSelection","DOMAINUsername:SessionID" )
msgbox(4096,"Output",@Error)

and also this one - error is also 0 - but the control does nothing.   When pressing the key manulally it works...

Run("C:\Windows\System32\msra.exe /offerRA CITRIXSERVER")
WinWait("Windows-Remoteunterstützung")
WinActivate( "Windows-Remoteunterstützung","")
$hWnd = ControlGetHandle ( "Windows-Remoteunterstützung", "", 1054 )

controlSend( $hWnd,"","ComboBox1","{RIGHT}")
msgbox(4096,"Output",@Error)

Edited by agivx3
Link to comment
Share on other sites

Should be

$iReturn = controlSend($hWnd,"","ComboBox1","{RIGHT}")
msgbox(4096,"Output", $iReturn)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

According to the help file: "Returns 0 if window/control is not found."

Did you try:

"The control might first need to be given focus with the ControlFocus command, specially when referencing an controlID created by the script itself."

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Here´s the actual code. Still showing 0

Run("C:\Windows\System32\msra.exe /offerRA CITRIXSERVER")
WinWait("Windows-Remoteunterstützung")
WinActivate( "Windows-Remoteunterstützung","")

$hWnd = ControlGetHandle ( "Windows-Remoteunterstützung", "", 1054 )

ControlFocus("Windows-Remoteunterstützung", "", 1054)
$ireturn = controlSend( $hWnd,"","ComboBox1","{RIGHT}")
msgbox(4096,"Output",$ireturn)

Link to comment
Share on other sites

Looks like the "Windows Remote Unterstützung" doesn't allow automation.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Sorry, don't know. But I fear you can't do what you want to do.

Can't you pass the needed data as command line parameters to msra.exe?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

For normal servers or workstations this would be possible, but for citrix this dont works because more parameters like username and sessionid must be choosen in msra.exe. That was why i wanted to use AutoIt for this...

I still don´t understand why the normal "send" don´t work´s. It should be the same as pressing the key manually.

Link to comment
Share on other sites

I still don´t understand why the normal "send" don´t work´s. It should be the same as pressing the key manually.

There are a lot of programs that can't be automated. Often administration tools do not allow GUI automation.

Maybe automation via PowerShell works?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I'm able to automate the english version:

#include <array.au3>
#include <GuiComboBox.au3>
#RequireAdmin
$name = "Remote Desktop Connection"
$hMSTSC = WinGetHandle($name)
If Not IsHWnd($hMSTSC) Then
    ConsoleWrite("can't find window...try using [CLASS:yourclass] to id the window...or update the name")
    Exit
Else
    WinActivate($hMSTSC)
EndIf

; Edit route...
$hEdit = ControlGetHandle($hMSTSC, "", "[CLASS:Edit; INSTANCE:1]")
If Not IsHWnd($hEdit) Then
    ConsoleWrite("can't find edit")
Else
    ControlFocus($hMSTSC, "", $hEdit)
    ControlSetText($hMSTSC, "", $hEdit, "test")
EndIf

; Combo route...
$hCombo = ControlGetHandle($hMSTSC, "", "[CLASS:ComboBox; INSTANCE:1]")
If Not IsHWnd($hCombo) Then
    ConsoleWrite("can't find combo")
Else
    $aData = _GUICtrlComboBox_GetListArray($hCombo)
    _ArrayDisplay($aData)
    For $i = 1 To UBound($aData)-1
        ConsoleWrite("_GUICtrlComboBox_SelectString=[" & $aData[$i] & "]")
        _GUICtrlComboBox_SelectString($hMSTSC, $aData[$i])
        Sleep (1000)
    Next
EndIf

the comb is no good (returns some other languages chars), but selecting the station to remote to is fine, so the rest should work, if you ID the controls properly

oops, wrong app...but try your script with #requireadmin

anyways, i'm able to interact with that app as well:

$name = "Windows Remote Assistance"
$hMSTSC = WinGetHandle($name)
If Not IsHWnd($hMSTSC) Then
    ConsoleWrite("can't find window...try using [CLASS:yourclass] to id the window...or update the name")
    Exit
Else
    WinActivate($hMSTSC)
EndIf

; get any button route...
$hButton = ControlGetHandle($hMSTSC, "", 248)
If Not IsHWnd($hButton) Then
    ConsoleWrite("can't find button")
Else
    ControlFocus($hMSTSC, "", $hButton)
    ControlClick($hMSTSC, "", $hButton)
EndIf
Exit
Edited by jdelaney
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.
Link to comment
Share on other sites

Everything else failing, you may need to distract the user, while your program takes control of their mouse, etc.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

  • Solution

Thx for all help. Finally this version worked:

$hCombo = ControlGetHandle("Windows-Remoteunterstützung","",1054)
    If Not IsHWnd($hCombo) Then
        ConsoleWrite("can't find combo")
    Else
        $aData = _GUICtrlComboBox_GetListArray($hCombo)
        ;_ArrayDisplay($aData)
        $iIndex = _ArraySearch($aData, "DOMAIN\User-ID", 0, 0, 0, 1)

        For $x = 1 to $iIndex-1
            Send("{DOWN}")
        Next
        Send("{ENTER}")
    EndIf
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...