Posted on 2007-01-05 09:16
tiger 阅读(1893)
评论(1) 编辑 收藏 引用
1、打开/关闭输入法
void CHideDlgDlg::OnButton9()
{
// TODO: Add your control notification handler code here
CWnd * pWnd = GetDlgItem(IDC_TREE1);
if (pWnd){
pWnd->SetFocus();
ImmSimulateHotKey(pWnd->m_hWnd, IME_CHOTKEY_IME_NONIME_TOGGLE);
HIMC hIMC = ImmGetContext(pWnd->m_hWnd);
DWORD dwConv, dwSent;
DWORD dwTemp;
ImmGetConversionStatus(hIMC,&dwConv,&dwSent);
dwConv |= IME_CMODE_SOFTKBD;
ImmSetConversionStatus(hIMC,dwConv,dwSent);
ImmReleaseContext(pWnd->m_hWnd,hIMC);
}
}
2、打开/关闭软键盘
void CHideDlgDlg::OnButton10()
{
// TODO: Add your control notification handler code here
CWnd * pWnd = GetDlgItem(IDC_TREE1);
if (pWnd){
pWnd->SetFocus();
HIMC hIMC = ImmGetContext(pWnd->m_hWnd);
DWORD dwConv, dwSent;
DWORD dwTemp;
ImmGetConversionStatus(hIMC,&dwConv,&dwSent);
if (dwConv & IME_CMODE_SOFTKBD)
dwConv &= ~IME_CMODE_SOFTKBD;
else
dwConv |= IME_CMODE_SOFTKBD;
ImmSetConversionStatus(hIMC,dwConv,dwSent);
ImmReleaseContext(pWnd->m_hWnd,hIMC);
}
}