Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
55ff0661
Commit
55ff0661
authored
Apr 10, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Don't fail on windows without menu bar in DrawMenuBar.
parent
b0458516
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
menu.c
dlls/user32/menu.c
+9
-8
menu.c
dlls/user32/tests/menu.c
+0
-2
msg.c
dlls/user32/tests/msg.c
+9
-2
No files found.
dlls/user32/menu.c
View file @
55ff0661
...
...
@@ -4360,17 +4360,18 @@ HMENU WINAPI GetSubMenu( HMENU hMenu, INT nPos )
BOOL
WINAPI
DrawMenuBar
(
HWND
hWnd
)
{
LPPOPUPMENU
lppop
;
HMENU
hMenu
=
GetMenu
(
hWnd
)
;
HMENU
hMenu
;
if
(
!
WIN_ALLOWED_MENU
(
GetWindowLongW
(
hWnd
,
GWL_STYLE
)
))
if
(
!
IsWindow
(
hWnd
))
return
FALSE
;
if
(
!
hMenu
||
!
(
lppop
=
MENU_GetMenu
(
hMenu
)))
return
FALSE
;
lppop
->
Height
=
0
;
/* Make sure we call MENU_MenuBarCalcSize */
lppop
->
hwndOwner
=
hWnd
;
SetWindowPos
(
hWnd
,
0
,
0
,
0
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_FRAMECHANGED
);
return
TRUE
;
if
((
hMenu
=
GetMenu
(
hWnd
))
&&
(
lppop
=
MENU_GetMenu
(
hMenu
)))
{
lppop
->
Height
=
0
;
/* Make sure we call MENU_MenuBarCalcSize */
lppop
->
hwndOwner
=
hWnd
;
}
return
SetWindowPos
(
hWnd
,
0
,
0
,
0
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_FRAMECHANGED
);
}
/***********************************************************************
...
...
dlls/user32/tests/menu.c
View file @
55ff0661
...
...
@@ -425,9 +425,7 @@ static void test_menu_locked_by_window(void)
ok
(
ret
,
"DestroyMenu failed with error %d
\n
"
,
GetLastError
());
ret
=
DrawMenuBar
(
hwnd
);
todo_wine
{
ok
(
ret
,
"DrawMenuBar failed with error %d
\n
"
,
GetLastError
());
}
ret
=
IsMenu
(
GetMenu
(
hwnd
));
ok
(
!
ret
||
broken
(
ret
)
/* nt4 */
,
"Menu handle should have been destroyed
\n
"
);
...
...
dlls/user32/tests/msg.c
View file @
55ff0661
...
...
@@ -4819,13 +4819,19 @@ static void test_messages(void)
after_end_dialog
=
FALSE
;
test_def_id
=
FALSE
;
hwnd
=
CreateWindowExA
(
0
,
"TestDialogClass"
,
NULL
,
WS_POPUP
,
hwnd
=
CreateWindowExA
(
0
,
"TestDialogClass"
,
NULL
,
WS_POPUP
|
WS_CHILD
,
0
,
0
,
100
,
100
,
0
,
0
,
GetModuleHandleA
(
0
),
NULL
);
ok
(
hwnd
!=
0
,
"Failed to create custom dialog window
\n
"
);
flush_sequence
();
trace
(
"call ShowWindow(%p, SW_SHOW)
\n
"
,
hwnd
);
ShowWindow
(
hwnd
,
SW_SHOW
);
ok_sequence
(
WmShowCustomDialogSeq
,
"ShowCustomDialog"
,
TRUE
);
flush_events
();
flush_sequence
();
ok
(
DrawMenuBar
(
hwnd
),
"DrawMenuBar failed: %d
\n
"
,
GetLastError
());
flush_events
();
ok_sequence
(
WmDrawMenuBarSeq
,
"DrawMenuBar"
,
FALSE
);
DestroyWindow
(
hwnd
);
flush_sequence
();
...
...
@@ -4836,7 +4842,8 @@ static void test_messages(void)
flush_sequence
();
/* Message sequence for SetMenu */
ok
(
!
DrawMenuBar
(
hwnd
),
"DrawMenuBar should return FALSE for a window without a menu
\n
"
);
ok
(
!
DrawMenuBar
(
hwnd
),
"DrawMenuBar should return FALSE for a destroyed window
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
,
"last error is %d
\n
"
,
GetLastError
());
ok_sequence
(
WmEmptySeq
,
"DrawMenuBar for a window without a menu"
,
FALSE
);
hmenu
=
CreateMenu
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment