epia Posted July 27, 2010 Share Posted July 27, 2010 Hello, i try to read the containing text of some controls of a programm that runs under WinNT. AutoIt runs well for most controls with ControlGetText. But for some controls ControlGetText fails. They give back only empty strings. As example the control tab of au3info says for one of the failing controls: Class Static Instance 138 ClassnameNN Static138 Advanced [Class: Static; Instance: 138] ID 8290 Text 23735 <== Needs this text, its a changing programm status information Position 1182, 835 Size 40, 15 Controlclick Coord. 19, 8 Ex.... Style... Handle 0x0001036A The control of this example is identified and accessable. I need as programm status information the Text that is marked in the example above (next under ID). The succesfull accessed controls doesnt show any text at that line with au3info.exe. It seems not to be a containing text but the control identification text which is used within the script commands e.g ControlGetText ( "title", "text", controlID ). So what kind of text is this? How to get the same data like the "Text" from au3info programmaticly with autoit script? Regards, epia. Link to comment Share on other sites More sharing options...
rvn Posted July 27, 2010 Share Posted July 27, 2010 try this $controltext = ControlGetText("wintitle","","[CLASS:Static; INSTANCE:138]") ConsoleWrite("$controltext " & $controltext & @CRLF) Link to comment Share on other sites More sharing options...
epia Posted July 28, 2010 Author Share Posted July 28, 2010 Hi rvn, thank you for helping. Your code is working succesfully for my "bad" controls. I tried it with $controltext = ControlGetText("wintitle","",8920). Why its better to use $controltext = ControlGetText("wintitle","","[CLASS:Static; INSTANCE:138]") ? Regards, epia Link to comment Share on other sites More sharing options...
rvn Posted July 28, 2010 Share Posted July 28, 2010 i never say it better... i though you fail with ID?! Link to comment Share on other sites More sharing options...
epia Posted July 28, 2010 Author Share Posted July 28, 2010 Hi rvn, obviously, you are right But of course i am interested in a technical reason to learn for better scripting. Yours, epia Link to comment Share on other sites More sharing options...
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