This is the first include file I designed
This work is especially directed to NVDA free screen reader users
It contains a set of functions that enable you to control the program
Such as forcing the program to read a custom text
Force it to stop talking
Find out if the program is running
And show custom text in the Braille screen
Available functions are
to load the dll file
to UnLoad the dll file
to speak a custom text
to show custom text in the Braille screen
to Force the NVDA to stop talking
to check if the NVDA is running
important note :
All of these functions depend on a nvdaControllerClient32.dll
I've added it in the attachments, as well as a file for examples, and other files
As the source and examples in other languages
For those who wanted to download the free screen reader, this is the download link from the official website
i hope you like this topic
I hope you will try it and give me your opinions
Thank you all members and administrators for their help
now with the Attachments
I wrote a script a few months ago that was working at the time. When I tried it today it wouldn't retrieve any controls. The application successfully launches, but I cannot figure out how to retrieve the control from the window that is launched. I'm on a windows 10 machine using AutoIt v184.108.40.206. The only thing I can think of that has changed is windows updates? Code is below, any help is greatly appreciated. ; Notes: ; HandleError( handleToCheck, MsgToLogOnFailure, terminateAutoItOnFail ) : function that simply checks the handle and quits AutoIt if not present ; all of this works well FileChangeDir( $CLIENT_APPLICATION_DIR ); Run( "Client.exe" ) Local $hClient = WinWaitActive( $CLIENT_TITLE, "", 10 ) $terminateOnFail = 1 HandleError( $hClient, "LaunchClient::Error: Failed to launch client. Either timed-out or failed.", $terminateOnFail ) LogToFile( "Client launched, waiting for system to ready." ) Sleep( 5000 ) ; this part does not work ; $SYSTEM_INDICATOR is a global variable. I have tried these values: "SystemIndicatorWindow" (Text), "Qt5QWindowIcon101" (ClassNN), and ; "[CLASS:Qt5QWindowIcon; INSTANCE:101]" Local $hStatusIndicator = ControlGetHandle( $hClient, "", $SYSTEM_INDICATOR ) HandleError( $hStatusIndicator, "CheckStatus::Error: couldn't retrieve control: " & $SYSTEM_INDICATOR, $terminateOnFail ) This is what the spy reveals:
Edit: I just tried this code and it works for notepad++.
FileChangeDir( "C:\Program Files\Notepad++\" ); Run( "notepad++.exe" ) Local $hNotePad = WinWaitActive( "new 1 - Notepad++", "", 10 ) If $hNotePad = 0 Or $hNotePad = -1 Then MsgBox( $MB_SYSTEMMODAL, "Error", "Error getting app handle." ) EndIf Sleep( 1000 ) Local $hNewFileBtn = ControlGetHandle( $hNotePad, "", "[CLASS:ToolbarWindow32; INSTANCE:1]" ) If $hNewFileBtn = 0 Or $hNewFileBtn = -1 Then MsgBox( $MB_SYSTEMMODAL, "Error", "Error getting button handle." ) EndIf MsgBox( $MB_SYSTEMMODAL, "Success", "Success." )
A UDF with Extended Functions for Window Management
Fixes WinGetClassList's barbaric returning of a @LF separated string instead of an array.
Automating applications that change their controls' handles/classes on each launch (e.g. half of Cisco's programs)
10/04/2016 (v0.4): _WinGetClassNNList Fixed : Not Returning an Index when using $2D_ARRAY _WinGetClassNNList Fixed : Not Properly returning $aArray[x] on Classes with instances > 9 when using $2D_ARRAY 10/03/2016 (v0.3): _WinGetClassList Added : Exactly the same as WinGetClassList but returns a more civilized Array _WinGetClassNNList Added : Returns Classes and their instances in either a 1D or 2D array depending on Flags _WindowGetHandleList Renamed: _WinGetHandleList SCRIPT BREAKING! _WindowGetHandleListFromPos Renamed: _WinGetHandleListFromPos SCRIPT BREAKING! 10/01/2016 (v0.2): WindowsExConstants.au3 Added : Flags in _WindowGetHandleListFromPos _WindowGetHandleListFromPos Removed: ConsoleWrite left in during debug _WindowGetHandleListFromPos Added : Flag for if part of a Control is at $X, $Y return it as well. 10/01/2016 (v0.1): _WindowGetHandleList Added : Retrieves the handles of classes from a window. _WindowGetHandleListFromPos Added : Retrieves the handles of classes at a specific position from a window. Known and Reported Bugs:
None reported To Do:
To Be Decided. Opinions welcome! Upcoming Changes:
To Be Decided.
I am playing with _GUICtrlButton_Create function. How can i change this button's (or the entire form's) font ?. The in-built GUICtrlSetFont function is not working even when i convert the control handle to control ID with _WinAPI_GetDlgCtrlID ( ) function. Do i need to use CreateFont api finction and send WM_SETFONT message ? Or is there any other easy and safe ways to do this ?. Thanks in advance.
Note : This window is created by CreateWindowEx function, not by GUICreate function.
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 v220.127.116.11 on Win7 Ultimate x64