How to get text on screen
-
I can see that you're cross posting, so what language are you interested in? Furthermore, your question is a bit fluffy, I think you have to be a bit more specific. As leppie says in the C# forum, it's not possible to just get the text at a certain point. But you can get the text from the HWND at the current corsor position, look up these functions in the Win32 API: WindowFromPoint, SetWindowsHookEx, GetWindowText, ChildWindowFromPoint. "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
-
do you want the text to appear within your application window or anywhere in screen(including the area out of your application window). 1) if you want the text to appear within your application window, handle WM_LBUTTONDOWN OR onLButtonDown(in mfc), and within that get the device context of client(GetClientDC(this)) and display the text using TextOut or DrawText.(use point for mouse location) 2) if you want the text to appear anywhere in screen, -Capture the mouse using SetCapture. -Get the screen device context, using CreateDC(NULL). -display the text using TextOut or DrawText.(use point for mouse location) :cool:
-
The word "get" is ambiguous here. Do you want to read text from the screen, or write text to the screen?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
The word "get" is ambiguous here. Do you want to read text from the screen, or write text to the screen?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
That will require use of the
IAccessible
interface, specifically theget_accValue()
method.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow