user32/tests: Add a basic test for maximizing windows.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b7cdfd312c
commit
d95be60ff6
@ -6528,8 +6528,9 @@ static void test_ShowWindow(void)
|
|||||||
{
|
{
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
DWORD style;
|
DWORD style;
|
||||||
RECT rcMain, rc, rcMinimized, rcClient, rcEmpty;
|
RECT rcMain, rc, rcMinimized, rcClient, rcEmpty, rcMaximized, rcResized;
|
||||||
LPARAM ret;
|
LPARAM ret;
|
||||||
|
MONITORINFO mon_info;
|
||||||
|
|
||||||
SetRect(&rcClient, 0, 0, 90, 90);
|
SetRect(&rcClient, 0, 0, 90, 90);
|
||||||
rcMain = rcClient;
|
rcMain = rcClient;
|
||||||
@ -6547,6 +6548,12 @@ static void test_ShowWindow(void)
|
|||||||
0, 0, 0, NULL);
|
0, 0, 0, NULL);
|
||||||
assert(hwnd);
|
assert(hwnd);
|
||||||
|
|
||||||
|
mon_info.cbSize = sizeof(mon_info);
|
||||||
|
GetMonitorInfoW(MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY), &mon_info);
|
||||||
|
rcMaximized = mon_info.rcWork;
|
||||||
|
AdjustWindowRectEx(&rcMaximized, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BORDER,
|
||||||
|
0, GetWindowLongA(hwnd, GWL_EXSTYLE));
|
||||||
|
|
||||||
style = GetWindowLongA(hwnd, GWL_STYLE);
|
style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||||
ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||||
ok(!(style & WS_VISIBLE), "window should not be visible\n");
|
ok(!(style & WS_VISIBLE), "window should not be visible\n");
|
||||||
@ -6617,6 +6624,35 @@ static void test_ShowWindow(void)
|
|||||||
ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n",
|
ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n",
|
||||||
wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
|
wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
|
||||||
|
|
||||||
|
ShowWindow(hwnd, SW_MAXIMIZE);
|
||||||
|
ok(ret, "not expected ret: %lu\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, &rc);
|
||||||
|
ok(EqualRect(&rcMaximized, &rc), "expected %s, got %s\n",
|
||||||
|
wine_dbgstr_rect(&rcMaximized), wine_dbgstr_rect(&rc));
|
||||||
|
/* maximized windows can be resized */
|
||||||
|
ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
|
||||||
|
ok(ret, "not expected ret: %lu\n", ret);
|
||||||
|
SetRect(&rcResized, 300, 300, 500, 500);
|
||||||
|
GetWindowRect(hwnd, &rc);
|
||||||
|
ok(EqualRect(&rcResized, &rc), "expected %s, got %s\n",
|
||||||
|
wine_dbgstr_rect(&rcResized), wine_dbgstr_rect(&rc));
|
||||||
|
|
||||||
|
ShowWindow(hwnd, SW_RESTORE);
|
||||||
|
ok(ret, "not expected ret: %lu\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, &rc);
|
||||||
|
ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain),
|
||||||
|
wine_dbgstr_rect(&rc));
|
||||||
|
|
||||||
ret = EnableWindow(hwnd, FALSE);
|
ret = EnableWindow(hwnd, FALSE);
|
||||||
ok(!ret, "not expected ret: %lu\n", ret);
|
ok(!ret, "not expected ret: %lu\n", ret);
|
||||||
style = GetWindowLongA(hwnd, GWL_STYLE);
|
style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user