给combobox 添加下拉选项
HWND myHwnd=GetDlgItem(hwnd,IDC_COMBOF1);//szCOMBO[i]);
SendMessage(myHwnd,CB_ADDSTRING,0, (LPARAM)(_T("选项1")));
SendMessage(myHwnd,CB_ADDSTRING,0, (LPARAM)(_T("选项2")));
SendMessage(myHwnd,CB_ADDSTRING,0, (LPARAM)(_T("选项3")));
获取选择的项
TCHAR szCombo[20];
GetDlgItemText(hwnd, IDC_COMBOF1, szCombo, 20);
if(wcscmp(szCombo,_T("选项1"))==0)
{
//GetShowOpenFile(hwnd,IDC_EDITF1);//打开文件
}
设置选择的项
HWND chwnd;
chwnd=GetDlgItem(hwnd,IDC_COMBOF1);//szCOMBO[i]);
SendMessage(chwnd, WM_SETTEXT, 0, (LPARAM)(_T("选项1")));