get_window_text of twapi can not get the text of another window's
application
from twapi:
get_window_text HWIN
Gets the title of a window or the text associated with a control.
In the latter case, the control must belong to the same application.
but autohotkey(https://www.autohotkey.com) can get the text of another window's application
I don't want drive autohotkey to do the work, I only want do this by Tcl.
I study a lot, may be we can use the raw window's API of
SendMessageTimeout of twapi to do this work. but I know a little C
language, and know nothing about Window's SDK, anyone can help me?
I can confirm, that this is possible, as long as it is the same user.
You will not see windows from Administrator user, if you are a normal user.
I recomment to put a ticket on TWAPI. This should be easy to change. I
may contribute the code I use to Ashok.
Am 12.08.2022 um 04:21 schrieb luocl:
get_window_text of twapi can not get the text of another window's
application
from twapi:
get_window_text HWIN
Gets the title of a window or the text associated with a control. >> In the latter case, the control must belong to the same application.
but autohotkey(https://www.autohotkey.com) can get the text of another
window's application
I don't want drive autohotkey to do the work, I only want do this by Tcl.
I study a lot, may be we can use the raw window's API of
SendMessageTimeout of twapi to do this work. but I know a little C
language, and know nothing about Window's SDK, anyone can help me?
I can confirm, that this is possible, as long as it is the same user.
You will not see windows from Administrator user, if you are a normal user.
I recomment to put a ticket on TWAPI. This should be easy to change. I
may contribute the code I use to Ashok.
Take care,
Harald
On 8/12/2022 11:55 AM, Harald Oehlmann wrote:
Am 12.08.2022 um 04:21 schrieb luocl:
get_window_text of twapi can not get the text of another window's
application
from twapi:
get_window_text HWIN
Gets the title of a window or the text associated with a
control. In the latter case, the control must belong to the same
application.
but autohotkey(https://www.autohotkey.com) can get the text of
another window's application
I don't want drive autohotkey to do the work, I only want do this by
Tcl.
I study a lot, may be we can use the raw window's API of
SendMessageTimeout of twapi to do this work. but I know a little C
language, and know nothing about Window's SDK, anyone can help me?
I can confirm, that this is possible, as long as it is the same user.
You will not see windows from Administrator user, if you are a normal
user.
I recomment to put a ticket on TWAPI. This should be easy to change. I
may contribute the code I use to Ashok.
Take care,
Harald
Harald,
Please post the code you use here or on the wiki so other folks can use it.
I am not likely to add it to TWAPI because while GetWindowText is
documented, use of WM_GETTEXT is somewhat fraught with pitfalls. The
correct handling can depend on the type of control, whether the window
is Unicode or not, whether it is using default handlers etc. The
returned value may be text, unicode, a window id, or even a handle.
So while a specific use case example would be useful, I'm hesitant to
add it as a general command to twapi and then have to support various
edge cases that don't work right.
AutoIt does it because they are far more cognizant of the vagaries of
Windows messages and controls whereas twapi is not (and will never be).
/Ashok
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 493 |
Nodes: | 16 (2 / 14) |
Uptime: | 33:12:21 |
Calls: | 9,740 |
Files: | 13,741 |
Messages: | 6,183,303 |