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
7e0c42e8
Commit
7e0c42e8
authored
May 17, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
May 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test that sending WM_CANCELMODE cancels tracking in window's menu bar.
parent
effc28e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
menu.c
dlls/user32/tests/menu.c
+24
-2
No files found.
dlls/user32/tests/menu.c
View file @
7e0c42e8
...
@@ -3266,7 +3266,8 @@ static void test_menu_cancelmode(void)
...
@@ -3266,7 +3266,8 @@ static void test_menu_cancelmode(void)
{
{
DWORD
ret
;
DWORD
ret
;
HWND
hwnd
,
hwndchild
;
HWND
hwnd
,
hwndchild
;
HMENU
menu
;
HMENU
menu
,
menubar
;
MSG
msg
;
if
(
!
pEndMenu
)
{
/* win95 */
if
(
!
pEndMenu
)
{
/* win95 */
win_skip
(
"EndMenu is not available
\n
"
);
win_skip
(
"EndMenu is not available
\n
"
);
return
;
return
;
...
@@ -3287,7 +3288,8 @@ static void test_menu_cancelmode(void)
...
@@ -3287,7 +3288,8 @@ static void test_menu_cancelmode(void)
ret
=
AppendMenuA
(
menu
,
MF_STRING
,
1
,
"winetest"
);
ret
=
AppendMenuA
(
menu
,
MF_STRING
,
1
,
"winetest"
);
ok
(
ret
,
"Functie failed lasterror is %u
\n
"
,
GetLastError
());
ok
(
ret
,
"Functie failed lasterror is %u
\n
"
,
GetLastError
());
/* seems to be needed only on wine :( */
/* seems to be needed only on wine :( */
{
MSG
msg
;
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);}
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
/* test the effect of sending a WM_CANCELMODE message in the WM_INITMENULOOP
/* test the effect of sending a WM_CANCELMODE message in the WM_INITMENULOOP
* handler of the menu owner */
* handler of the menu owner */
/* test results is extracted from variable g_got_enteridle. Possible values:
/* test results is extracted from variable g_got_enteridle. Possible values:
...
@@ -3314,7 +3316,27 @@ static void test_menu_cancelmode(void)
...
@@ -3314,7 +3316,27 @@ static void test_menu_cancelmode(void)
g_hwndtosend
=
hwnd
;
g_hwndtosend
=
hwnd
;
TrackPopupMenu
(
menu
,
TPM_RETURNCMD
,
100
,
100
,
0
,
hwndchild
,
NULL
);
TrackPopupMenu
(
menu
,
TPM_RETURNCMD
,
100
,
100
,
0
,
hwndchild
,
NULL
);
ok
(
g_got_enteridle
==
2
,
"received %d WM_ENTERIDLE messages, should be 2
\n
"
,
g_got_enteridle
);
ok
(
g_got_enteridle
==
2
,
"received %d WM_ENTERIDLE messages, should be 2
\n
"
,
g_got_enteridle
);
/* test canceling tracking in a window's menu bar */
menubar
=
CreateMenu
();
ok
(
menubar
!=
NULL
,
"CreateMenu failed with error %d
\n
"
,
GetLastError
());
ret
=
AppendMenuA
(
menubar
,
MF_POPUP
|
MF_STRING
,
(
UINT_PTR
)
menu
,
"winetest"
);
ok
(
ret
,
"AppendMenuA failed lasterror is %u
\n
"
,
GetLastError
());
ret
=
SetMenu
(
hwnd
,
menubar
);
ok
(
ret
,
"SetMenu failed lasterror is %u
\n
"
,
GetLastError
());
/* initiate tracking */
g_hwndtosend
=
hwnd
;
ret
=
SendMessage
(
hwnd
,
WM_SYSCOMMAND
,
SC_KEYMENU
,
0
);
ok
(
ret
==
0
,
"Sending WM_SYSCOMMAND/SC_KEYMENU failed lasterror is %u
\n
"
,
GetLastError
());
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
todo_wine
{
ok
(
g_got_enteridle
==
0
,
"received %d WM_ENTERIDLE messages, none expected
\n
"
,
g_got_enteridle
);
}
ok
(
g_got_enteridle
<
2
,
"received %d WM_ENTERIDLE messages, should be less than 2
\n
"
,
g_got_enteridle
);
/* cleanup */
/* cleanup */
DestroyMenu
(
menubar
);
DestroyMenu
(
menu
);
DestroyMenu
(
menu
);
DestroyWindow
(
hwndchild
);
DestroyWindow
(
hwndchild
);
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
...
...
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