lordicast Posted November 30, 2009 Posted November 30, 2009 I have been trying to use the ControlGetText func to read Hyperterminal with no success the window info tool gives it a class of SESSION_WINDOW and a Term Class INSTANCE:1 for the control ControlGetText('[CLASS:SESSION_WINDOW]','','Term Class1') ^- Is not working any ideas [Cheeky]Comment[/Cheeky]
Bert Posted December 1, 2009 Posted December 1, 2009 have you tried winlist, then wingethandle on the window in question? The Vollatran project My blog: http://www.vollysinterestingshit.com/
lordicast Posted December 1, 2009 Author Posted December 1, 2009 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]
Moderators SmOke_N Posted December 1, 2009 Moderators Posted December 1, 2009 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.
lordicast Posted December 1, 2009 Author Posted December 1, 2009 Nice Smoke, But I im killing myself over this ControlGetText func is there any other way? [Cheeky]Comment[/Cheeky]
Moderators SmOke_N Posted December 1, 2009 Moderators Posted December 1, 2009 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.
Zedna Posted December 1, 2009 Posted December 1, 2009 ControlGetText('[CLASS:SESSION_WINDOW]','','Term Class1') I think "'Term Class1'" shouldn't contain SPACES. Resources UDF ResourcesEx UDF AutoIt Forum Search
lordicast Posted December 1, 2009 Author Posted December 1, 2009 @Zedna Thats copied directly off of the Window Info tool, Tried it Termclass1;Term_Class1;Term Class:1 still no luck. Im currently looking into StdOutRead to see if thats maybe a option. [Cheeky]Comment[/Cheeky]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now