3,245
社区成员
发帖
与我相关
我的任务
分享
if(message == WM_IME_ENDCOMPOSITION)
{
HIMC hIMC = ImmGetContext(this->m_hWnd);
m_nIMECharLeft = m_nIMECharSize = ImmGetCompositionString(hIMC, GCS_RESULTSTR, 0, 0);
ImmReleaseContext(this->m_hWnd, hIMC);
}
if(m_nIMECharSize == 0)
DoInputChar(nChar);
else
{
m_nIMECharLeft -= 2;
if(m_nIMECharLeft == 0)
{
HIMC hIMC = ImmGetContext(this->m_hWnd);
WCHAR pBuf[1000]= {0};
DWORD dwSize = ImmGetCompositionString(hIMC, GCS_RESULTSTR, pBuf, 1000);
ImmReleaseContext(this->m_hWnd, hIMC);
DoInputString(pBuf);
m_nIMECharSize = 0;
}
}
LRESULT CXXXView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_IME_ENDCOMPOSITION)
{
HIMC hIMC = ImmGetContext(this->m_hWnd);
m_nIMECharSize = ImmGetCompositionString(hIMC, GCS_RESULTSTR, 0, 0);
ImmReleaseContext(this->m_hWnd, hIMC);
}
return CScrollView::WindowProc(message, wParam, lParam);
}