Commit dcdf4dbf authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

user32: Return early on child windows in DrawMenuBar.

parent 9d0f924d
......@@ -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 */
......
......@@ -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();
......
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