![](/img/trans.png)
[英]how to find the cursor position in text service frame work in windows8?
[英]how to get cursor position using GetSelection in text service framework windows8 application?
HRESULT hr;
TF_SELECTION tfSelection;
ULONG uFetched;
//Obtain the default selection.
hr = _pContext->GetSelection(ec, TF_DEFAULT_SELECTION, 1, &tfSelection, &uFetched);
UINT ar=(UINT)uFetched;
if(SUCCEEDED(hr) && (uFetched > 0))
{
UINT ar=(UINT)uFetched;
//Work with the selection.
//Release the selection range object.
tfSelection.range->Release();
}
大家好。 我正在DoEditSession方法中实现此代码。 当我尝试获得选择时,我总是将uFetched
的值uFetched
1。 但是光标位置没有到吗?
我正在使用Tsf界面为Windows RT开发文本服务。 我已经集成了一些库,这些库根据我们在候选窗口中键入的字母来建议单词。 现在,我需要获取文档中光标位置之前和之后的字母。 因此,这里我使用GetSelection来检索选定的文本。 问题是我无法检索文档(记事本)中的插入符号位置。 有没有什么具体方法可以使我在插入符号/光标位置周围找到字母/文本?
您可以移动选择范围的开始/结束而无需实际修改选择。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.