本帖最后由 zjq9931 于 2010-11-12 16:25:40 编辑

解决方案 »

  1.   

    1.开始ShowDropDown,鼠标不见了,查了一下解决了.
    可能还没解决好
      

  2.   

    IMM可以移动,但问题多多!void CxxxxDlg::MoveImm()
    {
    CPoint point;
    GetCursorPos(&point);
    // ScreenToClient(&point);
    // MapWindowPoints(&m_Combo,&point,1);
    point.x-=70;
    point.y+=60;
    HWND hWnd=::WindowFromPoint(point);//(hWnd != m_ListInCombo) && 
    if((hWnd != this->m_hWnd))
    {
    RECT rc;
    ::GetWindowRect(hWnd,&rc);
    afxDump << rc << " imm\n";
    ::MoveWindow(hWnd,rc.left,rc.top-((rc.bottom-rc.top)+30),
                  rc.right-rc.left,rc.bottom-rc.top,TRUE);
    }
    }
    //
    CListBox m_ListInCombo;
    //Get list in combo
    HBRUSH CListCheckDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
    {
    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

    // TODO: Change any attributes of the DC here
    if(pWnd->m_hWnd != m_LBox.m_hWnd)
    {
    if (nCtlColor == CTLCOLOR_LISTBOX)
    {//ListBox control,It is a COMBOLBOX,not a normal listbox.Besides,
    //It is not a child window of combobox.
    if (m_ListInCombo.GetSafeHwnd() == NULL)
    {
    m_ListInCombo.SubclassWindow(pWnd->GetSafeHwnd());
    }
    }
    }
    // TODO: Return a different brush if the default is not desired
    return hbr;
    }
      

  3.   

    换一个思路,把list放edit的上面可不可以?
      

  4.   

    见到一个实例,腾讯通RTX就实现了输入法选字框的移动.老大说的12楼说的imm是什么?
      

  5.   

    LZ真细心....要移动输入法窗口,可以枚举窗口类带CS_IME属性的,不过好像很麻烦.而且CS_IME好像也不是必须的....
      

  6.   

    LZ的Combo好像要完成autocomplete功能的,比较麻烦。
    IMM是输入法管理器,IME是输入法。
      

  7.   

    自动完成功能已经完成了,但怎么移动输入法的选字窗口,虽然找到了对应的函数,但试了半天不得要领望指点.
    代码如下: CString msg;
    POINT pt, *ppt;
    ppt=&pt;
    hImc=ImmGetContext(m_com.m_hWnd);   //取得输入窗口的上下文
    ImmGetStatusWindowPos(hImc, ppt); //取得输入法状态的窗口位置
    m_xy.Format("%d, %d", ppt->x, ppt->y);
    UpdateData(FALSE);
    但无论我把工作窗口移动到哪,取得的都是一个固定的点:2,970;
    是不是我哪写的不对啊?
      

  8.   

    输入法是取Caret的位置所以:
       CPoint point;
       GetCaretPos(&point);
    //    ScreenToClient(&point);
    //    MapWindowPoints(&m_Combo,&point,1);
        point.x+=16;
        point.y+=32;
        HWND hWnd=::WindowFromPoint(point);// no hide window 
        if((hWnd != 0)&&(hWnd != this->m_hWnd))
        {
            RECT rc;
            ::GetWindowRect(hWnd,&rc);
            afxDump << rc << " imm\n";
            ::MoveWindow(hWnd,rc.left,rc.top-((rc.bottom-rc.top)+30),
                              rc.right-rc.left,rc.bottom-rc.top,TRUE);
        }
     
     //不必hImc=ImmGetContext(m_com.m_hWnd);的