如题目所示。

解决方案 »

  1.   

    利用CEdit的WM_CHAR消息处理函数,检测nChar参数。
      

  2.   


    下面的代码用来屏蔽某一个控件的输入法状态。HIMC m_hImc = NULL;    // 全局或者成员变量// Function for Disabling IME
    void CMyDlg::DisableIME()
    {
    HWND hWnd = GetDlgItem(IDC_EDIT1)->m_hWnd;
    if (hWnd && IsWindow(hWnd))
    {
    // Get input context for backup. 
    m_hImc = ImmGetContext(hWnd);// Remove association the testing 
    if (m_hImc)
    ImmAssociateContext(hWnd, NULL);// Release input context
    ImmReleaseContext(hWnd, m_hImc);
    ::SetFocus(hWnd);
    }
    }
    // Function for Enabling IME
    void CMyDlg::EnableIME() 
    {
    HWND hWnd = GetDlgItem(IDC_EDIT1)->m_hWnd;
    if (hWnd && IsWindow(hWnd))
    {
    // Enable IME
    if (m_hImc)
    {
    // Associate the input context with testing window
    ImmAssociateContext(hWnd, m_hImc);
    m_hImc = NULL;
    }::SetFocus(hWnd);
    }
    }
    回复人: pomelowu(羽战士)
      

  3.   

    利用CEdit的WM_CHAR消息处理函数,检测nChar参数,好象大于255是中文
      

  4.   

    屏蔽输入法是不能过滤粘贴上去的中文,检查nChar参数,是大于127,而不是duyhui(一天到晚游泳的鱼)所说的255。
      

  5.   

    EagleTwenty(玄风残翼@鹰)说的有道理,多谢了!