void CCandidateWindow::_BeginUIElement() { BOOL bShow = TRUE; if(!_reg) { _InitList(); } _Update(); if((_hwnd == NULL) && (_depth == 0)) { ITfUIElementMgr *pUIElementMgr; if(_pTextService->_GetThreadMgr()->QueryInterface(IID_PPV_ARGS(&pUIElementMgr)) == S_OK) { pUIElementMgr->BeginUIElement(this, &bShow, &_dwUIElementId); if(!bShow) { pUIElementMgr->UpdateUIElement(_dwUIElementId); } SafeRelease(&pUIElementMgr); } } if(_hwnd == NULL) { _bShow = FALSE; } else { _bShow = bShow; } if(_bShow) { if(_hwnd != NULL) { SetWindowPos(_hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW); if(_reg) { if(_pInputModeWindow != NULL) { _pInputModeWindow->_Show(TRUE); } } if(_depth == 0) { NotifyWinEvent(EVENT_OBJECT_IME_SHOW, _hwnd, OBJID_CLIENT, CHILDID_SELF); } } } }
BOOL CCandidateWindow::_CanShowUIElement() { BOOL bShow = TRUE; ITfUIElementMgr *pUIElementMgr; if(_pTextService->_GetThreadMgr()->QueryInterface(IID_PPV_ARGS(&pUIElementMgr)) == S_OK) { pUIElementMgr->BeginUIElement(this, &bShow, &_dwUIElementId); pUIElementMgr->EndUIElement(_dwUIElementId); SafeRelease(&pUIElementMgr); } return bShow; }
HRESULT CCandidateListUIPresenter::BeginUIElement() { HRESULT hr = S_OK; ITfThreadMgr* pThreadMgr = _pTextService->_GetThreadMgr(); if (nullptr ==pThreadMgr) { hr = E_FAIL; goto Exit; } ITfUIElementMgr* pUIElementMgr = nullptr; hr = pThreadMgr->QueryInterface(IID_ITfUIElementMgr, (void **)&pUIElementMgr); if (hr == S_OK) { pUIElementMgr->BeginUIElement(this, &_isShowMode, &_uiElementId); pUIElementMgr->Release(); } Exit: return hr; }