Sign in to follow this  
Followers 0
agivx3

Control is not responding anyway

20 posts in this topic

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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}")

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

...and i tried only one command at a time and i know they are commented out now  :-)

Edited by agivx3

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Should be

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Ooops - your'e right. But the results are the same. $ireturn is 0 in both cases

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

And there´s no way roundabout ? Like using any winapi call´s ?

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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.

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

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


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

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

Share this post


Link to post
Share on other sites

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

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  
Followers 0