Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
11285464
Commit
11285464
authored
May 16, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
May 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Added GetMenuBarInfo tests.
parent
cd08b5a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
6 deletions
+54
-6
edit.c
dlls/user32/tests/edit.c
+54
-6
No files found.
dlls/user32/tests/edit.c
View file @
11285464
...
...
@@ -39,12 +39,14 @@ struct edit_notify {
static
struct
edit_notify
notifications
;
static
BOOL
(
WINAPI
*
pEndMenu
)
(
void
);
static
BOOL
(
WINAPI
*
pGetMenuBarInfo
)(
HWND
,
LONG
,
LONG
,
PMENUBARINFO
);
static
void
init_function_pointers
(
void
)
{
HMODULE
hdll
=
GetModuleHandleA
(
"user32"
);
pEndMenu
=
(
void
*
)
GetProcAddress
(
hdll
,
"EndMenu"
);
pGetMenuBarInfo
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetMenuBarInfo"
);
}
static
INT_PTR
CALLBACK
multi_edit_dialog_proc
(
HWND
hdlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
...
...
@@ -2134,6 +2136,7 @@ static void test_child_edit_wmkeydown(void)
static
int
got_en_setfocus
=
0
;
static
int
got_wm_capturechanged
=
0
;
static
LRESULT
(
CALLBACK
*
p_edit_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
static
LRESULT
CALLBACK
edit4_wnd_procA
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -2156,7 +2159,50 @@ static LRESULT CALLBACK edit4_wnd_procA(HWND hWnd, UINT msg, WPARAM wParam, LPAR
return
DefWindowProcA
(
hWnd
,
msg
,
wParam
,
lParam
);
}
static
void
test_contextmenu_focus
(
void
)
static
LRESULT
CALLBACK
edit_proc_proxy
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
case
WM_ENTERIDLE
:
{
MENUBARINFO
mbi
;
BOOL
ret
;
HWND
ctx_menu
=
(
HWND
)
lParam
;
memset
(
&
mbi
,
0
,
sizeof
(
mbi
));
mbi
.
cbSize
=
sizeof
(
mbi
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetMenuBarInfo
(
ctx_menu
,
OBJID_CLIENT
,
0
,
&
mbi
);
ok
(
ret
||
broken
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
)
/* NT */
,
"GetMenuBarInfo failed
\n
"
);
if
(
ret
)
{
ok
(
mbi
.
hMenu
!=
NULL
,
"mbi.hMenu = NULL
\n
"
);
ok
(
!
mbi
.
hwndMenu
,
"mbi.hwndMenu != NULL
\n
"
);
ok
(
mbi
.
fBarFocused
,
"mbi.fBarFocused = FALSE
\n
"
);
ok
(
mbi
.
fFocused
,
"mbi.fFocused = FALSE
\n
"
);
}
memset
(
&
mbi
,
0
,
sizeof
(
mbi
));
mbi
.
cbSize
=
sizeof
(
mbi
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetMenuBarInfo
(
ctx_menu
,
OBJID_CLIENT
,
1
,
&
mbi
);
ok
(
ret
||
broken
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_WINDOW_HANDLE
)
/* NT */
,
"GetMenuBarInfo failed
\n
"
);
if
(
ret
)
{
ok
(
mbi
.
hMenu
!=
NULL
,
"mbi.hMenu = NULL
\n
"
);
ok
(
!
mbi
.
hwndMenu
,
"mbi.hwndMenu != NULL
\n
"
);
ok
(
mbi
.
fBarFocused
,
"mbi.fBarFocused = FALSE
\n
"
);
ok
(
!
mbi
.
fFocused
,
"mbi.fFocused = TRUE
\n
"
);
}
pEndMenu
();
break
;
}
}
return
p_edit_proc
(
hWnd
,
msg
,
wParam
,
lParam
);
}
static
void
test_contextmenu
(
void
)
{
HWND
hwndMain
,
hwndEdit
;
...
...
@@ -2171,15 +2217,17 @@ static void test_contextmenu_focus(void)
assert
(
hwndEdit
);
SetFocus
(
NULL
);
SetCapture
(
hwndMain
);
SendMessage
(
hwndEdit
,
WM_CONTEXTMENU
,
(
WPARAM
)
hwndEdit
,
MAKEWORD
(
10
,
10
));
ok
(
got_en_setfocus
,
"edit box didn't get focused
\n
"
);
ok
(
got_wm_capturechanged
,
"main window capture did not change
\n
"
);
if
(
pGetMenuBarInfo
)
{
p_edit_proc
=
(
void
*
)
SetWindowLongPtr
(
hwndEdit
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
edit_proc_proxy
);
SendMessage
(
hwndEdit
,
WM_CONTEXTMENU
,
(
WPARAM
)
hwndEdit
,
MAKEWORD
(
10
,
10
));
}
DestroyWindow
(
hwndEdit
);
DestroyWindow
(
hwndMain
);
}
...
...
@@ -2516,7 +2564,7 @@ START_TEST(edit)
test_fontsize
();
test_dialogmode
();
if
(
pEndMenu
)
test_contextmenu
_focus
();
test_contextmenu
();
else
win_skip
(
"EndMenu is not available
\n
"
);
...
...
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