Getting Caret Position from another process  
Author Message
xtcnrg





PostPosted: Sat Nov 19 04:33:01 CST 2005 Top

Winforms >> Getting Caret Position from another process Does anyone know how I can get the caret position in terms of screen position
from the currently active window? By currently active window I don't mean
just mine, rather any window.

Basically the end result I want is to position a floating tooltip style
window next to wherever the user is typing (their caret) regardless of what
app they are using.

I've tried calling GetCaretPos, however this only seems to work when my app
currently has the focus. At all other times the POINT returned by
GetCaretPos is 0,0. I think this is due to other windows destroying their
Carets when they lose the focus.

Does any smart cookies out there have any ideas?

DotNet420  
 
 
MarkHoward





PostPosted: Sat Nov 19 04:33:01 CST 2005 Top

Winforms >> Getting Caret Position from another process Before calling GetCaretPos, you might want to call AttachThreadInput to
attach your thread to the thread that currently has the focus.

--mark


"Kym Phillpotts" wrote:

> Does anyone know how I can get the caret position in terms of screen position
> from the currently active window? By currently active window I don't mean
> just mine, rather any window.
>
> Basically the end result I want is to position a floating tooltip style
> window next to wherever the user is typing (their caret) regardless of what
> app they are using.
>
> I've tried calling GetCaretPos, however this only seems to work when my app
> currently has the focus. At all other times the POINT returned by
> GetCaretPos is 0,0. I think this is due to other windows destroying their
> Carets when they lose the focus.
>
> Does any smart cookies out there have any ideas?