Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
e42bd179
Commit
e42bd179
authored
May 29, 2017
by
Sebastian Lackner
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for window region of layered windows.
parent
d274f7ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
input.c
dlls/user32/tests/input.c
+70
-0
No files found.
dlls/user32/tests/input.c
View file @
e42bd179
...
...
@@ -87,6 +87,7 @@ static int (WINAPI *pGetMouseMovePointsEx) (UINT, LPMOUSEMOVEPOINT, LPMOUSEMOVEP
static
UINT
(
WINAPI
*
pGetRawInputDeviceList
)
(
PRAWINPUTDEVICELIST
,
PUINT
,
UINT
);
static
UINT
(
WINAPI
*
pGetRawInputDeviceInfoW
)
(
HANDLE
,
UINT
,
void
*
,
UINT
*
);
static
UINT
(
WINAPI
*
pGetRawInputDeviceInfoA
)
(
HANDLE
,
UINT
,
void
*
,
UINT
*
);
static
int
(
WINAPI
*
pGetWindowRgnBox
)(
HWND
,
LPRECT
);
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
#define MAXKEYEVENTS 12
...
...
@@ -154,6 +155,7 @@ static void init_function_pointers(void)
GET_PROC
(
GetRawInputDeviceList
);
GET_PROC
(
GetRawInputDeviceInfoW
);
GET_PROC
(
GetRawInputDeviceInfoA
);
GET_PROC
(
GetWindowRgnBox
);
hdll
=
GetModuleHandleA
(
"kernel32"
);
GET_PROC
(
IsWow64Process
);
...
...
@@ -3440,6 +3442,9 @@ static void test_Input_mouse(void)
DWORD
thread_id
;
WNDCLASSA
wclass
;
POINT
pt
,
pt_org
;
int
region_type
;
HRGN
hregion
;
RECT
region
;
MSG
msg
;
BOOL
ret
;
...
...
@@ -3678,6 +3683,12 @@ static void test_Input_mouse(void)
while
(
wait_for_message
(
&
msg
))
DispatchMessageA
(
&
msg
);
Sleep
(
100
);
if
(
pGetWindowRgnBox
)
{
region_type
=
pGetWindowRgnBox
(
hwnd
,
&
region
);
ok
(
region_type
==
ERROR
,
"expected ERROR, got %d
\n
"
,
region_type
);
}
got_button_down
=
got_button_up
=
FALSE
;
simulate_click
(
TRUE
,
150
,
150
);
while
(
wait_for_message
(
&
msg
))
...
...
@@ -3704,6 +3715,12 @@ static void test_Input_mouse(void)
while
(
wait_for_message
(
&
msg
))
DispatchMessageA
(
&
msg
);
Sleep
(
100
);
if
(
pGetWindowRgnBox
)
{
region_type
=
pGetWindowRgnBox
(
hwnd
,
&
region
);
ok
(
region_type
==
ERROR
,
"expected ERROR, got %d
\n
"
,
region_type
);
}
got_button_down
=
got_button_up
=
FALSE
;
simulate_click
(
TRUE
,
150
,
150
);
while
(
wait_for_message
(
&
msg
))
...
...
@@ -3732,6 +3749,12 @@ static void test_Input_mouse(void)
while
(
wait_for_message
(
&
msg
))
DispatchMessageA
(
&
msg
);
Sleep
(
100
);
if
(
pGetWindowRgnBox
)
{
region_type
=
pGetWindowRgnBox
(
hwnd
,
&
region
);
ok
(
region_type
==
ERROR
,
"expected ERROR, got %d
\n
"
,
region_type
);
}
got_button_down
=
got_button_up
=
FALSE
;
simulate_click
(
TRUE
,
150
,
150
);
while
(
wait_for_message
(
&
msg
))
...
...
@@ -3758,6 +3781,12 @@ static void test_Input_mouse(void)
while
(
wait_for_message
(
&
msg
))
DispatchMessageA
(
&
msg
);
Sleep
(
100
);
if
(
pGetWindowRgnBox
)
{
region_type
=
pGetWindowRgnBox
(
hwnd
,
&
region
);
ok
(
region_type
==
ERROR
,
"expected ERROR, got %d
\n
"
,
region_type
);
}
got_button_down
=
got_button_up
=
FALSE
;
simulate_click
(
TRUE
,
150
,
150
);
while
(
wait_for_message
(
&
msg
))
...
...
@@ -3785,6 +3814,12 @@ static void test_Input_mouse(void)
while
(
wait_for_message
(
&
msg
))
DispatchMessageA
(
&
msg
);
Sleep
(
100
);
if
(
pGetWindowRgnBox
)
{
region_type
=
pGetWindowRgnBox
(
hwnd
,
&
region
);
ok
(
region_type
==
ERROR
,
"expected ERROR, got %d
\n
"
,
region_type
);
}
got_button_down
=
got_button_up
=
FALSE
;
simulate_click
(
TRUE
,
150
,
150
);
while
(
wait_for_message
(
&
msg
))
...
...
@@ -3806,6 +3841,41 @@ static void test_Input_mouse(void)
ok
(
got_button_down
,
"expected WM_LBUTTONDOWN message
\n
"
);
ok
(
got_button_up
,
"expected WM_LBUTTONUP message
\n
"
);
hregion
=
CreateRectRgn
(
0
,
0
,
10
,
10
);
ok
(
hregion
!=
NULL
,
"CreateRectRgn failed
\n
"
);
ret
=
SetWindowRgn
(
hwnd
,
hregion
,
TRUE
);
ok
(
ret
,
"SetWindowRgn failed
\n
"
);
DeleteObject
(
hregion
);
while
(
wait_for_message
(
&
msg
))
DispatchMessageA
(
&
msg
);
Sleep
(
1000
);
if
(
pGetWindowRgnBox
)
{
region_type
=
pGetWindowRgnBox
(
hwnd
,
&
region
);
ok
(
region_type
==
SIMPLEREGION
,
"expected SIMPLEREGION, got %d
\n
"
,
region_type
);
}
got_button_down
=
got_button_up
=
FALSE
;
simulate_click
(
TRUE
,
150
,
150
);
while
(
wait_for_message
(
&
msg
))
{
DispatchMessageA
(
&
msg
);
if
(
msg
.
message
==
WM_LBUTTONDOWN
)
{
ok
(
msg
.
hwnd
==
button_win
,
"msg.hwnd = %p
\n
"
,
msg
.
hwnd
);
got_button_down
=
TRUE
;
}
else
if
(
msg
.
message
==
WM_LBUTTONUP
)
{
ok
(
msg
.
hwnd
==
button_win
,
"msg.hwnd = %p
\n
"
,
msg
.
hwnd
);
got_button_up
=
TRUE
;
break
;
}
}
ok
(
got_button_down
,
"expected WM_LBUTTONDOWN message
\n
"
);
ok
(
got_button_up
,
"expected WM_LBUTTONUP message
\n
"
);
DestroyWindow
(
hwnd
);
SetCursorPos
(
pt_org
.
x
,
pt_org
.
y
);
...
...
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