user32: Return early on child windows in DrawMenuBar.

This commit is contained in:
Piotr Caban 2014-09-23 16:51:53 +02:00 committed by Alexandre Julliard
parent 9d0f924d1b
commit dcdf4dbf15
2 changed files with 14 additions and 0 deletions

View File

@ -4360,6 +4360,8 @@ BOOL WINAPI DrawMenuBar( HWND hWnd )
if (!IsWindow( hWnd ))
return FALSE;
if (!WIN_ALLOWED_MENU(GetWindowLongW( hWnd, GWL_STYLE )))
return TRUE;
if ((hMenu = GetMenu( hWnd )) && (lppop = MENU_GetMenu( hMenu ))) {
lppop->Height = 0; /* Make sure we call MENU_MenuBarCalcSize */

View File

@ -4871,6 +4871,18 @@ static void test_messages(void)
flush_events();
ok_sequence(WmDrawMenuBarSeq, "DrawMenuBar", FALSE);
ok(SetCursorPos(pos.x, pos.y), "SetCursorPos failed\n");
DestroyWindow(hwnd);
hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_CHILD|WS_VISIBLE,
0, 0, 100, 100, hparent, 0, GetModuleHandleA(0), NULL);
ok(hwnd != 0, "Failed to create custom dialog window\n");
flush_events();
flush_sequence();
ok(DrawMenuBar(hwnd), "DrawMenuBar failed: %d\n", GetLastError());
flush_events();
ok_sequence(WmEmptySeq, "DrawMenuBar for a child window", FALSE);
DestroyWindow(hwnd);
flush_sequence();