-1

我在一个对话框中有两个组合框,问题是我想找出选择了哪个字符串并从组合框中获取消息。我有以下代码。但问题是,从这段代码中,我无法区分选择了哪个组合框,并且这段代码导致两个框的索引号相同。

if(HIWORD(wParam) == CBN_SELCHANGE){
        _formatIndex = SendMessage((HWND) lParam, (UINT) CB_GETCURSEL, (WPARAM) 0, (LPARAM) IDD_IMAGES_MODE);
        _savingModeIndex = SendMessage((HWND) lParam, (UINT) CB_GETCURSEL, (WPARAM) 0, (LPARAM) IDC_COMBOBOX_TIME_FRAME);
    }
4

1 回答 1

1

实际上我只是找到了答案,这是代码:

    if(HIWORD(wParam) == CBN_SELCHANGE){
        if(LOWORD(wParam)==IDD_IMAGES_MODE){
        _formatIndex = SendMessage((HWND) lParam, (UINT) CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
        }
        if(LOWORD(wParam)==IDC_COMBOBOX_TIME_FRAME){
        _savingModeIndex = SendMessage((HWND) lParam, (UINT) CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
        }           
    }
于 2013-04-22T14:08:19.320 回答