MattHiggs Posted April 14 Share Posted April 14 Hello all. So I have a pretty simple script: Autoit launches an external executable, which is a tool which displays information about Portable Executable files, with some arguments (the path to a portable executable), and I then want autoit to capture the text of a particular control in the executable's GUI. I will attach the external executable in a zipped archive so that you have it if you need it. The script is as follows: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.5 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here $file = FileOpenDialog ( "Select executable file", @UserProfileDir & "\Downloads", "Executable files (*.exe)", 3 ) If $file = "" Then Exit EndIf If Not FileExists(@TempDir & "\peid.exe") Then FileInstall("C:\Users\temp\Desktop\peid.exe", @TempDir & "\peid.exe") EndIf Run('peid.exe -hard "' & $file & '"', @TempDir) WinWait("PEiD v0.95") Do Sleep(100) $IDString = ControlGetText("PEiD v0.95", "", "[CLASS:Edit; INSTANCE:2]") MsgBox(1, "", $IDString) Until $IDString <> "Scanning..." And $IDString <> "" WinClose("PEiD v0.95") Now, take a look at this photo: Ok, so, as you can see from the code, the control whose text I want to capture is "[CLASS:Edit; INSTANCE:2]." When I run the script and have it capture the text from that control using "GetControlText" and output the text to a message box, you can see that it correctly captures the indicated control's text. However, when I look at the properties of the control using the Autoit Window info tool that is included with autoit, as you can see, it reports that the same control does not have any text associated with it. This is odd, as the control viewer created by autoit's own @Yashied (thank you @Yashied) does successfully return the text associated with the control. This seems to be an issue with the built-in Autoit window info tool, which I would consider to be a pretty big deal. I don't know about the rest of you, but the Autoit window info tool is the primary tool that I use when analyzing GUIs, their controls, and the properties of both, and whatever it says I used to consider law: as in the tool accurately reported all the information that autoit is also able to see (so if the window info tool reports that a control has no text, it has no text, end of discussion). It was only out of sheer persistence that I decided to get this script working that I tried using a different control viewer at all, whereas I would have likely abandoned a less important project after viewing the information provided by the window info tool. Don't know if anyone else really cares, but I still felt like I should report the problem. peid.zip Link to comment Share on other sites More sharing options...
Andreik Posted April 14 Share Posted April 14 Not sure about all details of how Info Tool works, but probably the text is shown under Visible Text tab. Link to comment Share on other sites More sharing options...
argumentum Posted April 14 Share Posted April 14 2 hours ago, MattHiggs said: However, when I look at the properties of the control using the Autoit Window info tool that is included with autoit, as you can see, it reports that the same control does not have any text associated with it. 2 hours ago, MattHiggs said: Don't know if anyone else really cares, but I still felt like I should report the problem. We care. I too write code that don't use but is out there and worked when I regarded it as done. Without feedback I would not know if there are problems with it. Thanks for posting. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Danyfirex Posted April 15 Share Posted April 15 (edited) You're right inspect tool don't show the text but element is on top. weird. Saludos Edited April 15 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
junkew Posted April 19 Share Posted April 19 https://www.autoitscript.com/trac/autoit/newticket FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
argumentum Posted April 19 Share Posted April 19 1 minute ago, junkew said: https://www.autoitscript.com/trac/autoit/newticket ...no. You do it ! Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. 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