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
1ba63827
Commit
1ba63827
authored
Apr 08, 2014
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Apr 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add some tests for edit control context menu messages.
parent
08153864
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
edit.c
dlls/user32/tests/edit.c
+59
-0
No files found.
dlls/user32/tests/edit.c
View file @
1ba63827
...
...
@@ -2243,9 +2243,49 @@ static LRESULT CALLBACK edit_proc_proxy(HWND hWnd, UINT msg, WPARAM wParam, LPAR
return
p_edit_proc
(
hWnd
,
msg
,
wParam
,
lParam
);
}
struct
context_menu_messages
{
unsigned
int
wm_command
,
em_setsel
;
};
static
struct
context_menu_messages
menu_messages
;
static
LRESULT
CALLBACK
child_edit_menu_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
case
WM_ENTERIDLE
:
if
(
wParam
==
MSGF_MENU
)
{
HWND
hwndMenu
=
(
HWND
)
lParam
;
MENUBARINFO
mbi
=
{
sizeof
(
MENUBARINFO
)
};
if
(
pGetMenuBarInfo
(
hwndMenu
,
OBJID_CLIENT
,
0
,
&
mbi
))
{
MENUITEMINFOA
mii
=
{
sizeof
(
MENUITEMINFOA
),
MIIM_STATE
};
if
(
GetMenuItemInfoA
(
mbi
.
hMenu
,
EM_SETSEL
,
FALSE
,
&
mii
))
{
if
(
mii
.
fState
&
MFS_HILITE
)
{
PostMessageA
(
hwnd
,
WM_KEYDOWN
,
VK_RETURN
,
0x1c0001
);
PostMessageA
(
hwnd
,
WM_KEYUP
,
VK_RETURN
,
0x1c0001
);
}
else
{
PostMessageA
(
hwnd
,
WM_KEYDOWN
,
VK_DOWN
,
0x500001
);
PostMessageA
(
hwnd
,
WM_KEYUP
,
VK_DOWN
,
0x500001
);
}
}
}
}
break
;
case
WM_COMMAND
:
menu_messages
.
wm_command
++
;
break
;
case
EM_SETSEL
:
menu_messages
.
em_setsel
++
;
break
;
}
return
CallWindowProcA
(
p_edit_proc
,
hwnd
,
msg
,
wParam
,
lParam
);
}
static
void
test_contextmenu
(
void
)
{
HWND
hwndMain
,
hwndEdit
;
MSG
msg
;
hwndMain
=
CreateWindowA
(
szEditTest4Class
,
"ET4"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
0
,
0
,
200
,
200
,
NULL
,
NULL
,
hinst
,
NULL
);
...
...
@@ -2270,6 +2310,25 @@ static void test_contextmenu(void)
}
DestroyWindow
(
hwndEdit
);
hwndEdit
=
CreateWindowA
(
"EDIT"
,
"Test Text"
,
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
0
,
0
,
100
,
100
,
hwndMain
,
NULL
,
hinst
,
NULL
);
memset
(
&
menu_messages
,
0
,
sizeof
(
menu_messages
));
p_edit_proc
=
(
void
*
)
SetWindowLongPtrA
(
hwndEdit
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
child_edit_menu_proc
);
SetFocus
(
hwndEdit
);
SendMessageA
(
hwndEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"foo"
);
SendMessageA
(
hwndEdit
,
WM_CONTEXTMENU
,
(
WPARAM
)
hwndEdit
,
MAKEWORD
(
-
1
,
-
1
));
while
(
PeekMessageA
(
&
msg
,
hwndEdit
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
todo_wine
ok
(
menu_messages
.
wm_command
==
0
,
"Expected no WM_COMMAND messages, got %d
\n
"
,
menu_messages
.
wm_command
);
todo_wine
ok
(
menu_messages
.
em_setsel
==
1
,
"Expected 1 EM_SETSEL message, got %d
\n
"
,
menu_messages
.
em_setsel
);
DestroyWindow
(
hwndEdit
);
DestroyWindow
(
hwndMain
);
}
...
...
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