Jump to content

Window Info tool , ControlGetText


 Share

Recommended Posts

Yes using,

Func WinGetTerminal()
    $var = WinList()
    For $i = 1 To $var[0][0]
        If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then
            $strg = StringInStr($var[$i][0], 'HyperTerminal')
            If $strg > 0 Then
                Global $HyperTerminal = $var[$i][0]
            EndIf
        EndIf
    Next
EndFunc   ;==>WinGetTerminal

Func IsVisible($handle)
    If BitAND(WinGetState($handle), 2) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc   ;==>IsVisible

Big problem with that is the handle name constantly changes IE; Machine1 - Hyperterminal, Machine2 - Hyperterminal. This is why I use the above at the start of script.

Intresting that ControlSend does work but ControlSetText and ControlGetText dont? :)

[Cheeky]Comment[/Cheeky]
Link to comment
Share on other sites

  • Moderators

Yes using,

Func WinGetTerminal()
    $var = WinList()
    For $i = 1 To $var[0][0]
        If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then
            $strg = StringInStr($var[$i][0], 'HyperTerminal')
            If $strg > 0 Then
                Global $HyperTerminal = $var[$i][0]
            EndIf
        EndIf
    Next
EndFunc   ;==>WinGetTerminal

Func IsVisible($handle)
    If BitAND(WinGetState($handle), 2) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc   ;==>IsVisible

Big problem with that is the handle name constantly changes IE; Machine1 - Hyperterminal, Machine2 - Hyperterminal. This is why I use the above at the start of script.

Intresting that ControlSend does work but ControlSetText and ControlGetText dont? :)

No need to loop through all the windows in your function.

Global $HyperTerminal = WinGetHandle("[REGEXPTITLE:(?i).*?Machine\d+ - Hyperterminal.*?\z]")

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Nice Smoke, But I im killing myself over this ControlGetText func is there any other way?

I don't have hyperterminal on this pc ( Win7, the alternative is winrs ) to test, but if it comes up like telnet or in a command prompt, you're basically SOL with traditional windows manipulation.

If it's in a command prompt, I remember Valik writing quite a few functions for 7zip that he was able to manipulate data in the command prompt ( I believe, it's been so long since I've read it ) with dll calls ( an obvious search query would be valik+7zip on this one, if the native search doesn't help, try google ).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...