开发者

Find screen position of the Caret in windows CE. (equiv to GetGUIThreadInfo?)

开发者 https://www.devze.com 2023-01-26 20:06 出处:网络
I\'m creating a custom soft-input-panel and would like to find the position of the Caret. I could then move the SIP out of way if it is covering the position where text开发者_如何学Python is being ent

I'm creating a custom soft-input-panel and would like to find the position of the Caret. I could then move the SIP out of way if it is covering the position where text开发者_如何学Python is being entered.

It sounds like in windows the way to do this would be with GetGUIThreadInfo(). However, it appears that API is not supported in Windows CE (specifically CE 6.0 R3).

Is there an alternate method of finding this same information? A way of determining the active window and where text would be entered on it?

Thanks!


The caret should only be displayed on the window that has focus and is active. How about something like:

POINT cp;
GetCaretPos(&cp); // in client coordinates
HWND hActive=GetActiveWindow();

If you needed more information (like a specific child window), you could convert the point returned by GetCaretPos() into screen coordinates, then use WindowFromPoint() to convert back to a specific (child) window handle.

0

精彩评论

暂无评论...
验证码 换一张
取 消