![](/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.