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
0b273d27
Commit
0b273d27
authored
Sep 29, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add cross-process mouse click test.
parent
c86bd676
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
14 deletions
+57
-14
win.c
dlls/user32/tests/win.c
+57
-14
No files found.
dlls/user32/tests/win.c
View file @
0b273d27
...
...
@@ -7216,12 +7216,45 @@ todo_wine
ok
(
ret
,
"UnregisterClass(my_window) failed
\n
"
);
}
static
void
simulate_click
(
int
x
,
int
y
)
{
INPUT
input
[
2
];
UINT
events_no
;
SetCursorPos
(
x
,
y
);
memset
(
input
,
0
,
sizeof
(
input
));
input
[
0
].
type
=
INPUT_MOUSE
;
U
(
input
[
0
]).
mi
.
dx
=
x
;
U
(
input
[
0
]).
mi
.
dy
=
y
;
U
(
input
[
0
]).
mi
.
dwFlags
=
MOUSEEVENTF_LEFTDOWN
;
input
[
1
].
type
=
INPUT_MOUSE
;
U
(
input
[
1
]).
mi
.
dx
=
x
;
U
(
input
[
1
]).
mi
.
dy
=
y
;
U
(
input
[
1
]).
mi
.
dwFlags
=
MOUSEEVENTF_LEFTUP
;
events_no
=
SendInput
(
2
,
input
,
sizeof
(
input
[
0
]));
ok
(
events_no
==
2
,
"SendInput returned %d
\n
"
,
events_no
);
}
static
WNDPROC
def_static_proc
;
static
BOOL
got_hittest
;
static
LRESULT
WINAPI
static_hook_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
if
(
msg
==
WM_NCHITTEST
)
got_hittest
=
TRUE
;
if
(
msg
==
WM_LBUTTONDOWN
)
ok
(
0
,
"unexpected call
\n
"
);
return
def_static_proc
(
hwnd
,
msg
,
wp
,
lp
);
}
static
void
window_from_point_proc
(
HWND
parent
)
{
HANDLE
start_event
,
end_event
;
HANDLE
win
,
child_static
,
child_button
;
BOOL
got_click
;
DWORD
ret
;
POINT
pt
;
MSG
msg
;
start_event
=
OpenEventA
(
EVENT_ALL_ACCESS
,
FALSE
,
"test_wfp_start"
);
ok
(
start_event
!=
0
,
"OpenEvent failed
\n
"
);
...
...
@@ -7242,8 +7275,28 @@ static void window_from_point_proc(HWND parent)
win
=
WindowFromPoint
(
pt
);
ok
(
win
==
child_button
,
"WindowFromPoint returned %p, expected %p
\n
"
,
win
,
child_button
);
/* without this window simulate click test keeps sending WM_NCHITTEST
* message to child_static in an infinite loop */
win
=
CreateWindowExA
(
0
,
"button"
,
"button"
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
100
,
100
,
parent
,
0
,
NULL
,
NULL
);
ok
(
win
!=
0
,
"CreateWindowEx failed
\n
"
);
def_static_proc
=
(
void
*
)
SetWindowLongPtrA
(
child_static
,
GWLP_WNDPROC
,
(
LONG_PTR
)
static_hook_proc
);
flush_events
(
TRUE
);
SetEvent
(
start_event
);
got_hittest
=
FALSE
;
got_click
=
FALSE
;
while
(
!
got_click
&&
wait_for_message
(
&
msg
))
{
if
(
msg
.
message
==
WM_LBUTTONUP
)
{
ok
(
msg
.
hwnd
==
win
,
"msg.hwnd = %p, expected %p
\n
"
,
msg
.
hwnd
,
win
);
got_click
=
TRUE
;
}
DispatchMessageA
(
&
msg
);
}
ok
(
got_hittest
,
"transparent window didn't get WM_NCHITTEST message
\n
"
);
todo_wine
ok
(
got_click
,
"button under static window didn't get WM_LBUTTONUP
\n
"
);
ret
=
WaitForSingleObject
(
end_event
,
5000
);
ok
(
ret
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %x
\n
"
,
ret
);
...
...
@@ -7306,6 +7359,9 @@ static void test_window_from_point(const char *argv0)
win
=
WindowFromPoint
(
pt
);
ok
(
win
==
child
,
"WindowFromPoint returned %p, expected %p
\n
"
,
win
,
child
);
simulate_click
(
150
,
150
);
flush_events
(
TRUE
);
child
=
GetWindow
(
child
,
GW_HWNDNEXT
);
pt
.
x
=
250
;
win
=
WindowFromPoint
(
pt
);
...
...
@@ -7838,20 +7894,7 @@ START_TEST(win)
if
(
!
SetForegroundWindow
(
hwndMain
))
{
/* workaround for foreground lock timeout */
INPUT
input
[
2
];
UINT
events_no
;
memset
(
input
,
0
,
sizeof
(
input
));
input
[
0
].
type
=
INPUT_MOUSE
;
U
(
input
[
0
]).
mi
.
dx
=
101
;
U
(
input
[
0
]).
mi
.
dy
=
101
;
U
(
input
[
0
]).
mi
.
dwFlags
=
MOUSEEVENTF_LEFTDOWN
;
input
[
0
].
type
=
INPUT_MOUSE
;
U
(
input
[
0
]).
mi
.
dx
=
101
;
U
(
input
[
0
]).
mi
.
dy
=
101
;
U
(
input
[
0
]).
mi
.
dwFlags
=
MOUSEEVENTF_LEFTUP
;
events_no
=
SendInput
(
2
,
input
,
sizeof
(
input
[
0
]));
ok
(
events_no
==
2
,
"SendInput returned %d
\n
"
,
events_no
);
simulate_click
(
101
,
101
);
ok
(
SetForegroundWindow
(
hwndMain
),
"SetForegroundWindow failed
\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