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
16c054c3
Commit
16c054c3
authored
Feb 14, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for maximizing and minimizing MDI child windows.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2ebfe4c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
127 additions
and
0 deletions
+127
-0
win.c
dlls/user32/tests/win.c
+127
-0
No files found.
dlls/user32/tests/win.c
View file @
16c054c3
...
...
@@ -6979,6 +6979,132 @@ static void test_ShowWindow_child(HWND hwndMain)
DestroyWindow
(
hwnd
);
}
static
void
test_ShowWindow_mdichild
(
HWND
hwndMain
)
{
RECT
rect
,
orig
,
expect
;
BOOL
ret
;
HWND
mdiclient
,
hwnd
,
hwnd2
;
LONG
style
;
POINT
pt
=
{
0
};
CLIENTCREATESTRUCT
mdi_client_cs
=
{
0
,
1
};
SetRect
(
&
orig
,
20
,
20
,
210
,
110
);
GetClientRect
(
hwndMain
,
&
rect
);
mdiclient
=
CreateWindowA
(
"mdiclient"
,
"MDI client"
,
WS_CHILD
,
rect
.
left
,
rect
.
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
hwndMain
,
0
,
0
,
&
mdi_client_cs
);
ok
(
!!
mdiclient
,
"failed to create window, error %u
\n
"
,
GetLastError
());
hwnd
=
CreateWindowExA
(
WS_EX_MDICHILD
,
"MainWindowClass"
,
"MDI child"
,
WS_CAPTION
|
WS_SYSMENU
|
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
,
orig
.
left
,
orig
.
top
,
orig
.
right
-
orig
.
left
,
orig
.
bottom
-
orig
.
top
,
mdiclient
,
0
,
0
,
NULL
);
ok
(
!!
hwnd
,
"failed to create window, error %u
\n
"
,
GetLastError
());
hwnd2
=
CreateWindowExA
(
WS_EX_MDICHILD
,
"MainWindowClass"
,
"MDI child 2"
,
WS_CAPTION
|
WS_SYSMENU
|
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
,
orig
.
left
,
orig
.
top
,
orig
.
right
-
orig
.
left
,
orig
.
bottom
-
orig
.
top
,
mdiclient
,
0
,
0
,
NULL
);
ok
(
!!
hwnd2
,
"failed to create window, error %u
\n
"
,
GetLastError
());
ClientToScreen
(
hwndMain
,
&
pt
);
OffsetRect
(
&
orig
,
pt
.
x
,
pt
.
y
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should not be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rect
);
ok
(
EqualRect
(
&
orig
,
&
rect
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
orig
),
wine_dbgstr_rect
(
&
rect
));
ret
=
ShowWindow
(
hwnd
,
SW_MINIMIZE
);
ok
(
ret
,
"wrong ret %d
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
style
&
WS_MINIMIZE
,
"window should be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rect
);
GetClientRect
(
hwndMain
,
&
expect
);
SetRect
(
&
expect
,
0
,
expect
.
bottom
-
GetSystemMetrics
(
SM_CYMINIMIZED
),
GetSystemMetrics
(
SM_CXMINIMIZED
),
expect
.
bottom
);
OffsetRect
(
&
expect
,
pt
.
x
,
pt
.
y
);
todo_wine
ok
(
EqualRect
(
&
expect
,
&
rect
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
expect
),
wine_dbgstr_rect
(
&
rect
));
/* shouldn't be able to resize minimized windows */
ret
=
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
200
,
200
,
SWP_NOMOVE
|
SWP_NOACTIVATE
|
SWP_NOZORDER
);
ok
(
ret
,
"wrong ret %d
\n
"
,
ret
);
GetWindowRect
(
hwnd
,
&
rect
);
todo_wine
ok
(
EqualRect
(
&
expect
,
&
rect
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
expect
),
wine_dbgstr_rect
(
&
rect
));
/* multiple minimized children also stack; here the parent is too small to
* fit more than one per row */
OffsetRect
(
&
expect
,
0
,
-
GetSystemMetrics
(
SM_CYMINIMIZED
));
ret
=
ShowWindow
(
hwnd2
,
SW_MINIMIZE
);
ok
(
ret
,
"wrong ret %d
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd2
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
style
&
WS_MINIMIZE
,
"window should be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd2
,
&
rect
);
todo_wine
ok
(
EqualRect
(
&
expect
,
&
rect
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
expect
),
wine_dbgstr_rect
(
&
rect
));
ShowWindow
(
hwnd
,
SW_RESTORE
);
ok
(
ret
,
"wrong ret %d
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rect
);
ok
(
EqualRect
(
&
orig
,
&
rect
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
orig
),
wine_dbgstr_rect
(
&
rect
));
ShowWindow
(
hwnd
,
SW_MAXIMIZE
);
ok
(
ret
,
"wrong ret %d
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should be minimized
\n
"
);
ok
(
style
&
WS_MAXIMIZE
,
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rect
);
GetClientRect
(
hwndMain
,
&
expect
);
AdjustWindowRectEx
(
&
expect
,
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
~
WS_BORDER
,
0
,
GetWindowLongA
(
hwnd
,
GWL_EXSTYLE
));
OffsetRect
(
&
expect
,
pt
.
x
,
pt
.
y
);
ok
(
EqualRect
(
&
expect
,
&
rect
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
expect
),
wine_dbgstr_rect
(
&
rect
));
/* maximized windows can be resized */
ret
=
SetWindowPos
(
hwnd
,
0
,
300
,
300
,
200
,
200
,
SWP_NOACTIVATE
|
SWP_NOZORDER
);
ok
(
ret
,
"wrong ret %d
\n
"
,
ret
);
GetWindowRect
(
hwnd
,
&
rect
);
SetRect
(
&
expect
,
300
,
300
,
500
,
500
);
OffsetRect
(
&
expect
,
pt
.
x
,
pt
.
y
);
ok
(
EqualRect
(
&
expect
,
&
rect
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
expect
),
wine_dbgstr_rect
(
&
rect
));
ShowWindow
(
hwnd
,
SW_RESTORE
);
ok
(
ret
,
"wrong ret %d
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rect
);
ok
(
EqualRect
(
&
orig
,
&
rect
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
orig
),
wine_dbgstr_rect
(
&
rect
));
DestroyWindow
(
hwnd2
);
DestroyWindow
(
hwnd
);
DestroyWindow
(
mdiclient
);
}
static
DWORD
CALLBACK
enablewindow_thread
(
LPVOID
arg
)
{
HWND
hwnd
=
arg
;
...
...
@@ -11345,6 +11471,7 @@ START_TEST(win)
test_ShowWindow
();
test_ShowWindow_owned
(
hwndMain
);
test_ShowWindow_child
(
hwndMain
);
test_ShowWindow_mdichild
(
hwndMain
);
test_EnableWindow
();
test_gettext
();
test_GetUpdateRect
();
...
...
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