2 posts in this topic
Hello all! I have had some issues reading text from different types of windows, occasionally, specifically with controlgettext.
**Before I begin, I know there are better ways to do what I attempt in the example below. That's not the point of this post. The point is my issues with controlgettext.
I am about to cite an example with an application you may be familiar with called SpeedFan (v4.52). My problem is not specific to speedfan, it is simply the most recent and easily reproducible example I can think of.
So, the goal of the script below is to get a string of text containing the current fan RPMs from the highlighted control in the screenshot below (see "speedfan_control_details.png").
Now, here's a simple script for grabbing the window handle and reading the text from that control:
$wintitle = "SpeedFan 4.52" $controlID = "197934" ;will be reformatted as "[ID:######]" $hwnd = wingethandle($wintitle) if @error<>0 then msgbox(0, "WinGetHandle", "FAILURE. @error="&@error) Exit EndIf $text = ControlGetText($hwnd, "", "[ID:"&$controlID&"]") if @error=1 then msgbox(0, "ControlGetText", "FAILURE. @error="&@error) ;failure returns "" and @error=1 Exit EndIf msgbox (0, "ControlGetText", "SUCCESS. @error="&@error &@CRLF& "$text="&$text) ;success returns string and @error=0 You'll see that the ControlGetText operation runs without error, however it does not capture any text from the control. If you explore the other controls in this one window, you'll find mixed results across the board. Neither the temps nor voltages can be read, while the log field and some other elements can be read. Even when you read the text from the whole window, those elements are not included in the visible nor hidden texts.
I have run into this issue many times in the past- inconsistencies in the ability of autoit to interact with certain controls. What is it which makes this text different than any other readable texts? Is there an alternate method of reading the text in the window/control which could work? Any and all info to help me solve this mystery and satisfy my curiosity would be greatly appreciated.
Thanks -Rob C
PS: Running Autoit v22.214.171.124 on Win7 Ultimate x64
I want create retractable bar using autoit
I tried creating slider, but there's a problem with screen reader for the blind, so is there another retractable tape?
It is advisable to not accept dragging with the keybord only with mouse
This bar is needed in the process of raising and lowering the volume
I hope that there is a solution to do that
i waiting your responses.
Thanks in advance to all members and administrators
How are you?
I have a question, to you please.
How do I create an edit box for numbers only and does not accept letters? using autoit
greetings to all
I hope you help ME
Thanks to all in advance
I hope you can help me with this need. In the company I work for, every time we need to deploy a change into a Production environment, we need to add a SharePoint entry in a Calendar area. This is in order to notify Operations team that a change will be introduced on a specific date.
The fields we need to fill out are:
ows_Project ows_ChangeReq ows_Description ows_StartDate ows_EndDate The thing is that, I have all these values available in an AutoIT application I built called EAI Tool so, what I need is: Whenever a user click a button, a SharePoint record should be created populating SharePoint fields with the values from EAI Tool applicacion.
If you need additional information, let me know.