Howto get text from editbox of another application?
-
pliz help me... i want to get the text string from the focused editbox of focused application... how can i do it?
GetWindowText ? I believe if you have the HWND of the app, you can get the HWND of the focused control. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
GetWindowText ? I believe if you have the HWND of the app, you can get the HWND of the focused control. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
It it has the focus, you can call GetFocus, I presume this will return the control that has the focus, not the parent window. You don't even need the windows HWND. If I'm wrong, you can iterate looking for the control with focus with GetNextDlgTabItem. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
pliz help me... i want to get the text string from the focused editbox of focused application... how can i do it?
See also this MSDN article by Paul DiLascia.
-
It it has the focus, you can call GetFocus, I presume this will return the control that has the focus, not the parent window. You don't even need the windows HWND. If I'm wrong, you can iterate looking for the control with focus with GetNextDlgTabItem. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
you are wrong... but... i have found the function that enums all child windows of the the parent window... BUT! i dont know how to find out whether it has focus or not :(
call:
HWND GetFocus()
orstatic CWnd* PASCAL GetFocus()
in MFC -
you are wrong... but... i have found the function that enums all child windows of the the parent window... BUT! i dont know how to find out whether it has focus or not :(
Use CWnd::GetForegroundWindow() to get the top-level CWnd that currently has focus. Then, iterate through its child windows as mentioned earlier. /ravi "There is always one more bug..." ravib@ravib.com http://www.ravib.com