Hi,
As you can see below, both windowspy and wingettext are reporting incorrect text.
How should I proceed ?
WindowSpy and WinGetText reporting incorrect text
Re: WindowSpy and WinGetText reporting incorrect text
It works with the control under the mouse. You might need to activate the target window first.
How you should proceed depends on your goal, whatever that is.
How you should proceed depends on your goal, whatever that is.
Re: WindowSpy and WinGetText reporting incorrect text
The control was under the mouse, WinGetTitle() returns « help »
I need WinGetText to return « test »
I need WinGetText to return « test »
Re: WindowSpy and WinGetText reporting incorrect text
ControlGetText() returns an empty string, as shown below.
The image, text and button have distinct ClassNN : Button2, Static1 and Button8
The image, text and button have distinct ClassNN : Button2, Static1 and Button8
Re: WindowSpy and WinGetText reporting incorrect text
Please show the code you used.
Re: WindowSpy and WinGetText reporting incorrect text
Code: Select all
#y::
{
MouseGetPos &aX, &aY, &Win, &CNNX
Tooltip(ControlGetText(CNNX, "A"))
}
#x::
{
Tooltip(WinGetText("A"))
}
Re: WindowSpy and WinGetText reporting incorrect text
I would have done the following, but it sounds like that’s going to come up empty.
It seems odd that this window has these simple, distinct controls that don’t reveal their text, but that is apparently the case. The only other thing I can think to try is running the script as administrator.
Code: Select all
MsgBox ControlGetText('Static1', 'help ahk_class WinDevObject ahk_exe wdtst.exe')
Re: WindowSpy and WinGetText reporting incorrect text
I get the same result with your code and running as admin.
Should this be moved to bug reports ?
The code to reproduce is :
NextTitle("help")
Error("test")
With Windev :
https://windev.com/windev/WD-Express.htm
Should this be moved to bug reports ?
The code to reproduce is :
NextTitle("help")
Error("test")
With Windev :
https://windev.com/windev/WD-Express.htm
Re: WindowSpy and WinGetText reporting incorrect text
Could you move it to the wish list ?
Re: WindowSpy and WinGetText reporting incorrect text
You’re not understanding. It’s not an AHK issue. What would the wish list say? For windows where the text isn’t available in the controls, get the text anyway?
You can try other approaches like using the Acc library or OCR.
You can try other approaches like using the Acc library or OCR.
Re: WindowSpy and WinGetText reporting incorrect text
The text has to be in there somewhere, how else would it be displayed ? And why does AHK report text that is not displayed on screen ?
Acc does not report the correct text either : I would appreciate if a developper could take a look at this.
If not, any pointers to help me debug ahk myself ?
Acc does not report the correct text either : I would appreciate if a developper could take a look at this.
If not, any pointers to help me debug ahk myself ?
Re: WindowSpy and WinGetText reporting incorrect text
Lots of ways. Take a look at an Excel or Chrome window and try grabbing the text from controls. Not sure why you’re insisting it has to be available by that method. There are probably more applications where the text isn’t available via that method than those that are.
Again, it’s not an AHK bug, but feel free to create a fork of AHK from the C++ source code that finds all text in all windows. Please share it when you have it solved.
Who is online
Users browsing this forum: bobstoner289, Draken and 65 guests