Hi,

Am developing an application which requires knowledge of the current state
of input (text string and caret position of a Control) in a third-party
application.

e.g. my application must be able to get the text contents and input position
from the edit box in the Notes application. The solution must not be
application specific, however alternate solutions for each kind of control
(e.g. edit box) are acceptable.

This is currently in Pocket PC 2003, however will also need to know about
Mobile 5 and Smartphone 2003 for the future.

Any alternative solutions to re-writing the GWES would be preferable! ;)

Cheers,
Azztech.

p.s. The application I'm writing is a SIP (Soft Input Panel).

Re: Getting text and caret position from a control in another application by r_z_aret

r_z_aret
Tue Jul 19 17:24:29 CDT 2005

On Tue, 19 Jul 2005 18:56:44 +0100, "Azztech" <azztech@hotmail.com>
wrote:

>Hi,
>
>Am developing an application which requires knowledge of the current state
>of input (text string and caret position of a Control) in a third-party
>application.
>
>e.g. my application must be able to get the text contents and input position
>from the edit box in the Notes application. The solution must not be
>application specific, however alternate solutions for each kind of control
>(e.g. edit box) are acceptable.
>
>This is currently in Pocket PC 2003, however will also need to know about
>Mobile 5 and Smartphone 2003 for the future.
>
>Any alternative solutions to re-writing the GWES would be preferable! ;)

For C/C++, straight Win32:

You can send EM_GETSEL messages to edit boxes in any application.
Other types of controls have similar messages, but I don't know them
off hand. That's the simple part.

The hard part is finding all the appropriate windows. Folks who are
targeting specific controls can use Spy to get enough info appropriate
for use in FindWindow. A more general solution (such as you want) will
probably require using EnumWindows.

You didn't say which language/development environment you are using.
If you give us more info, someone (probably not me, unless you're
using straight Win32), will have a better chance of helping.


>
>Cheers,
>Azztech.
>
>p.s. The application I'm writing is a SIP (Soft Input Panel).
>

I'm pretty sure most SIPs emulate a keyboard to send keys to whatever
window has focus. The relevant Win32 function is keybd_event. I
commend you for trying to do something more robust, but I think your
approach will involve a _lot_ of extra work to provide a relative
improvement.

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com