Commit 30fa4cb5 authored by Jay Yang's avatar Jay Yang Committed by Alexandre Julliard

comctl32: Make ComboBoxEx send CBEN_ENDEDIT when selecting from the dropdown list.

parent 583641bc
...@@ -1122,8 +1122,8 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam) ...@@ -1122,8 +1122,8 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
case CBN_DROPDOWN: case CBN_DROPDOWN:
SetFocus (infoPtr->hwndCombo); SetFocus (infoPtr->hwndCombo);
ShowWindow (infoPtr->hwndEdit, SW_HIDE); ShowWindow (infoPtr->hwndEdit, SW_HIDE);
infoPtr->flags |= WCBE_ACTEDIT;
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
case CBN_CLOSEUP: case CBN_CLOSEUP:
SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
/* /*
......
...@@ -42,6 +42,8 @@ static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR ...@@ -42,6 +42,8 @@ static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR
#define MAX_CHARS 100 #define MAX_CHARS 100
static char *textBuffer = NULL; static char *textBuffer = NULL;
static BOOL received_end_edit = FALSE;
static HWND createComboEx(DWORD style) { static HWND createComboEx(DWORD style) {
return CreateWindowExA(0, WC_COMBOBOXEXA, NULL, style, 0, 0, 300, 300, return CreateWindowExA(0, WC_COMBOBOXEXA, NULL, style, 0, 0, 300, 300,
hComboExParentWnd, NULL, hMainHinst, NULL); hComboExParentWnd, NULL, hMainHinst, NULL);
...@@ -341,6 +343,7 @@ static void test_WM_LBUTTONDOWN(void) ...@@ -341,6 +343,7 @@ static void test_WM_LBUTTONDOWN(void)
ok(idx == 4 || ok(idx == 4 ||
broken(idx == -1), /* win98 */ broken(idx == -1), /* win98 */
"Current Selection: expected %d, got %d\n", 4, idx); "Current Selection: expected %d, got %d\n", 4, idx);
ok(received_end_edit, "Expected to receive a CBEN_ENDEDIT message\n");
DestroyWindow(hComboEx); DestroyWindow(hComboEx);
} }
...@@ -427,6 +430,30 @@ static void test_WM_WINDOWPOSCHANGING(void) ...@@ -427,6 +430,30 @@ static void test_WM_WINDOWPOSCHANGING(void)
ok(ret, "DestroyWindow failed\n"); ok(ret, "DestroyWindow failed\n");
} }
static LRESULT ComboExTestOnNotify(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
NMHDR *hdr = (NMHDR*)lParam;
switch(hdr->code){
case CBEN_ENDEDITA:
{
NMCBEENDEDITA *edit_info = (NMCBEENDEDITA*)hdr;
if(edit_info->iWhy==CBENF_DROPDOWN){
received_end_edit = TRUE;
}
break;
}
case CBEN_ENDEDITW:
{
NMCBEENDEDITW *edit_info = (NMCBEENDEDITW*)hdr;
if(edit_info->iWhy==CBENF_DROPDOWN){
received_end_edit = TRUE;
}
break;
}
}
return 0;
}
static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
switch(msg) { switch(msg) {
...@@ -434,7 +461,8 @@ static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, L ...@@ -434,7 +461,8 @@ static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, L
case WM_DESTROY: case WM_DESTROY:
PostQuitMessage(0); PostQuitMessage(0);
break; break;
case WM_NOTIFY:
return ComboExTestOnNotify(hWnd,msg,wParam,lParam);
default: default:
return DefWindowProcA(hWnd, msg, wParam, lParam); return DefWindowProcA(hWnd, msg, wParam, lParam);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment