get the text in the window with focus

get the text in the window with focus

Post by David Elli » Mon, 07 Jul 2003 00:14:49



I am working on a keyboard replacement for Pocket PC.

Is there a way to get the text and the current cursor position of the
window that has the focus?

Thanks,

Dave

 
 
 

get the text in the window with focus

Post by Yaroslav Goncharo » Tue, 08 Jul 2003 15:50:30


Hi

it is easy to do in the same process:
 - GetFocus - get a focus window
 - GetWindowText - get text
 - you can use EM_GETSEL for a cursor position, if selection is empty

If you are in another process GetFocus won't work.

In fact you don't need all these tricks if you implement your keyboard
replacement as a custom input method. See the following article for details:
http://www.pocketpcdn.com/articles/im.html

--
Yaroslav Goncharov
Microsoft MVP - Mobile Devices
Smartphone Developer Network
www.smartphonedn.com


Quote:> I am working on a keyboard replacement for Pocket PC.

> Is there a way to get the text and the current cursor position of the
> window that has the focus?

> Thanks,

> Dave


 
 
 

1. Getting focus of active Control...

Hello,

I just want to implement a simple "Copy to Clipboard" Routine
from a main Menu. And therefore I have to get the HWND of the
current control.

Is there a API Function to get the HWND of an active (= Control
that has the focus) Edit-Control ?

regards..

2. date problem

3. SIP appearing when focus is in edit windows

4. using the Automated Interface in Visual Studio

5. Always on top windows that do not loose focus.

6. Problem solved.

7. Getting typed text from editable CComboBox

8. HELP: IBM M-Motion Card!!!!

9. getting text from a edit-combo box

10. Alt text in windows CE

11. How to find text in a window?

12. Getting window class from its handle.

13. String comparsion and how to display text in the main- window