添加ON_CBN_CLOSEUP消息映射宏
在框架的头文件中添加此消息处理函数
afx_msg void MyProcess();在框架的CPP文件中实现上面的函数,并加入消息映射宏
ON_CBN_CLOSEUP(ID_MYCOMBOBOX_TEST, MyProcess)OK.....

解决方案 »

  1.   

    楼上的两位大哥,在此先谢了
    不过小弟我想要的是类似SDK的处理
    方式,这个CBN_CLOSEUP到底是什么
    消息呢?MSDN上说是WM_COMMAND
    如下:
    The CBN_CLOSEUP notification message is sent when the list box of a combo box has been closed. The parent window of the combo box receives this notification message through the WM_COMMAND message. CBN_CLOSEUP 
    idComboBox = (int) LOWORD(wParam);  // identifier of combo box 
    hwndComboBox = (HWND) lParam;       // handle to combo box  
    可是我该如何用呢???
    多谢了
      

  2.   

    是一个WM_COMMAND消息:
    WM_COMMAND
    wNotifyCode = HIWORD(wParam); // notification code 
    wID = LOWORD(wParam);         // item, control, or accelerator identifier 
    hwndCtl = (HWND) lParam;      // handle of control 
    对于CBN_CLOSEUP 传来的WM_COMMAND消息是这样的:
    wNotifyCode = CBN_CLOSEUP;
    idComboBox = wID = LOWORD(wParam);
    hwndComboBox = hwndCtl = (HWND) lParam; 
      

  3.   

    谢谢In355Hz给的提示,不过我试了一下,好象不行,
    不知道我哪儿弄错了
    代码如下:
    BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
        if( pMsg->hwnd == m_wndColorBox.GetSafeHwnd() 
            && HIWORD(pMsg->wParam)==CBN_CLOSEUP) {
            ::MessageBox(NULL,"OK","",MB_OK);
        }

    return CFrameWnd::PreTranslateMessage(pMsg);
    }