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.
精彩评论