win32 sdk 在dialog上采用createwindow创建combobox不正常,其无法正常下拉
当鼠标点击combo时,下拉框自动下拉但又收回//求达人指导BOOLCALLBACKDlgProc(HWNDhDlg,UINTmessage,WPARAMwParam,L...
当鼠标点击combo时,下拉框自动下拉但又收回
//求达人指导
BOOL CALLBACK DlgProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{
static HWND hwnd_combo_1;
static HINSTANCE hInstance;
switch(message)
{
case WM_INITDIALOG:
hInstance=HINSTANCE(GetWindowLong(hDlg,GWL_HINSTANCE));
hwnd_combo_1=CreateWindow(t("combobox"),null,
WS_CHILD|WS_VISIBLE|CBS_DROPDOWN,120,10,150,80,hDlg,HMENU(ID_COMBO),hInstance,null);
SendMessage(hwnd_combo_1,CB_INSERTSTRING,0,LPARAM(t("apple")));
SendMessage(hwnd_combo_1,CB_INSERTSTRING,1,LPARAM(t("paror")));
break;
default:
return false;
}
return true;
} 展开
//求达人指导
BOOL CALLBACK DlgProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{
static HWND hwnd_combo_1;
static HINSTANCE hInstance;
switch(message)
{
case WM_INITDIALOG:
hInstance=HINSTANCE(GetWindowLong(hDlg,GWL_HINSTANCE));
hwnd_combo_1=CreateWindow(t("combobox"),null,
WS_CHILD|WS_VISIBLE|CBS_DROPDOWN,120,10,150,80,hDlg,HMENU(ID_COMBO),hInstance,null);
SendMessage(hwnd_combo_1,CB_INSERTSTRING,0,LPARAM(t("apple")));
SendMessage(hwnd_combo_1,CB_INSERTSTRING,1,LPARAM(t("paror")));
break;
default:
return false;
}
return true;
} 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏35(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询