本文整理汇总了C++中ITfContext::GetDocumentMgr方法的典型用法代码示例。如果您正苦于以下问题:C++ ITfContext::GetDocumentMgr方法的具体用法?C++ ITfContext::GetDocumentMgr怎么用?C++ ITfContext::GetDocumentMgr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITfContext
的用法示例。
在下文中一共展示了ITfContext::GetDocumentMgr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSetFocus
STDAPI CSampleIME::OnSetFocus(_In_ ITfDocumentMgr *pDocMgrFocus, _In_ ITfDocumentMgr *pDocMgrPrevFocus)
{
pDocMgrPrevFocus;
_InitTextEditSink(pDocMgrFocus);
_UpdateLanguageBarOnSetFocus(pDocMgrFocus);
//
// We have to hide/unhide candidate list depending on whether they are
// associated with pDocMgrFocus.
//
if (_pCandidateListUIPresenter)
{
ITfDocumentMgr* pCandidateListDocumentMgr = nullptr;
ITfContext* pTfContext = _pCandidateListUIPresenter->_GetContextDocument();
if ((nullptr != pTfContext) && SUCCEEDED(pTfContext->GetDocumentMgr(&pCandidateListDocumentMgr)))
{
if (pCandidateListDocumentMgr != pDocMgrFocus)
{
_pCandidateListUIPresenter->OnKillThreadFocus();
}
else
{
_pCandidateListUIPresenter->OnSetThreadFocus();
}
pCandidateListDocumentMgr->Release();
}
}
if (_pDocMgrLastFocused)
{
_pDocMgrLastFocused->Release();
_pDocMgrLastFocused = nullptr;
}
_pDocMgrLastFocused = pDocMgrFocus;
if (_pDocMgrLastFocused)
{
_pDocMgrLastFocused->AddRef();
}
return S_OK;
}
示例2: OnSetThreadFocus
STDAPI CIME::OnSetThreadFocus()
{
if (_pCandidateListUIPresenter)
{
ITfDocumentMgr* pCandidateListDocumentMgr = nullptr;
ITfContext* pTfContext = _pCandidateListUIPresenter->_GetContextDocument();
if ((nullptr != pTfContext) && SUCCEEDED(pTfContext->GetDocumentMgr(&pCandidateListDocumentMgr)))
{
if (pCandidateListDocumentMgr == _pDocMgrLastFocused)
{
_pCandidateListUIPresenter->OnSetThreadFocus();
}
pCandidateListDocumentMgr->Release();
}
}
return S_OK;
}
示例3: OnKillThreadFocus
STDAPI CSampleIME::OnKillThreadFocus()
{
if (_pCandidateListUIPresenter)
{
ITfDocumentMgr* pCandidateListDocumentMgr = nullptr;
ITfContext* pTfContext = _pCandidateListUIPresenter->_GetContextDocument();
if ((nullptr != pTfContext) && SUCCEEDED(pTfContext->GetDocumentMgr(&pCandidateListDocumentMgr)))
{
if (_pDocMgrLastFocused)
{
_pDocMgrLastFocused->Release();
_pDocMgrLastFocused = nullptr;
}
_pDocMgrLastFocused = pCandidateListDocumentMgr;
if (_pDocMgrLastFocused)
{
_pDocMgrLastFocused->AddRef();
}
}
_pCandidateListUIPresenter->OnKillThreadFocus();
}
return S_OK;
}