user32/tests: Use wine_dbgstr_rect() in the win tests.
Signed-off-by: Michael Stefaniuc <mstefani@redhat.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b3d8b56e2c
commit
ea50a4f8d8
|
@ -807,14 +807,14 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
|
||||||
if (0)
|
if (0)
|
||||||
{
|
{
|
||||||
/* Uncomment this once the test succeeds in all cases */
|
/* Uncomment this once the test succeeds in all cases */
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)\n",
|
ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom );
|
wine_dbgstr_rect(&rc2));
|
||||||
|
|
||||||
GetClientRect(hwnd, &rc2);
|
GetClientRect(hwnd, &rc2);
|
||||||
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc1);
|
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc1);
|
||||||
MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
|
MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)\n",
|
ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom );
|
wine_dbgstr_rect(&rc2));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1083,26 +1083,23 @@ static void test_nonclient_area(HWND hwnd)
|
||||||
FixedAdjustWindowRectEx(&rc, style, menu, exstyle);
|
FixedAdjustWindowRectEx(&rc, style, menu, exstyle);
|
||||||
|
|
||||||
ok(EqualRect(&rc, &rc_window),
|
ok(EqualRect(&rc, &rc_window),
|
||||||
"window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=(%d,%d)-(%d,%d), calc=(%d,%d)-(%d,%d)\n",
|
"window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=%s, calc=%s\n",
|
||||||
style, exstyle, menu, rc_window.left, rc_window.top, rc_window.right, rc_window.bottom,
|
style, exstyle, menu, wine_dbgstr_rect(&rc_window), wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
CopyRect(&rc, &rc_client);
|
CopyRect(&rc, &rc_client);
|
||||||
MapWindowPoints(hwnd, 0, (LPPOINT)&rc, 2);
|
MapWindowPoints(hwnd, 0, (LPPOINT)&rc, 2);
|
||||||
wine_AdjustWindowRectEx(&rc, style, menu, exstyle);
|
wine_AdjustWindowRectEx(&rc, style, menu, exstyle);
|
||||||
ok(EqualRect(&rc, &rc_window),
|
ok(EqualRect(&rc, &rc_window),
|
||||||
"window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=(%d,%d)-(%d,%d), calc=(%d,%d)-(%d,%d)\n",
|
"window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=%s, calc=%s\n",
|
||||||
style, exstyle, menu, rc_window.left, rc_window.top, rc_window.right, rc_window.bottom,
|
style, exstyle, menu, wine_dbgstr_rect(&rc_window), wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
|
|
||||||
CopyRect(&rc, &rc_window);
|
CopyRect(&rc, &rc_window);
|
||||||
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
|
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
|
||||||
MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2);
|
MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2);
|
||||||
ok(EqualRect(&rc, &rc_client),
|
ok(EqualRect(&rc, &rc_client),
|
||||||
"client rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d client=(%d,%d)-(%d,%d), calc=(%d,%d)-(%d,%d)\n",
|
"client rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d client=%s, calc=%s\n",
|
||||||
style, exstyle, menu, rc_client.left, rc_client.top, rc_client.right, rc_client.bottom,
|
style, exstyle, menu, wine_dbgstr_rect(&rc_client), wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
/* NULL rectangle shouldn't crash */
|
/* NULL rectangle shouldn't crash */
|
||||||
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, 0);
|
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, 0);
|
||||||
|
@ -1122,9 +1119,8 @@ static void test_nonclient_area(HWND hwnd)
|
||||||
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
|
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc);
|
||||||
MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2);
|
MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2);
|
||||||
ok(EqualRect(&rc, &rc_client),
|
ok(EqualRect(&rc, &rc_client),
|
||||||
"synthetic rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, client=(%d,%d)-(%d,%d), calc=(%d,%d)-(%d,%d)\n",
|
"synthetic rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, client=%s, calc=%s\n",
|
||||||
style, exstyle, menu, rc_client.left, rc_client.top, rc_client.right, rc_client.bottom,
|
style, exstyle, menu, wine_dbgstr_rect(&rc_client), wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||||
|
@ -1777,8 +1773,7 @@ static void MDI_ChildGetMinMaxInfo( HWND client, HWND hwnd, MINMAXINFO* lpMinMax
|
||||||
lpMinMax->ptMaxPosition.x = rect.left;
|
lpMinMax->ptMaxPosition.x = rect.left;
|
||||||
lpMinMax->ptMaxPosition.y = rect.top;
|
lpMinMax->ptMaxPosition.y = rect.top;
|
||||||
|
|
||||||
trace("max rect (%d,%d - %d, %d)\n",
|
trace("max rect %s\n", wine_dbgstr_rect(&rect));
|
||||||
rect.left, rect.top, rect.right, rect.bottom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||||
|
@ -1957,16 +1952,14 @@ static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, L
|
||||||
SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
|
SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
|
||||||
/* note: winpos coordinates are relative to parent */
|
/* note: winpos coordinates are relative to parent */
|
||||||
MapWindowPoints(GetParent(hwnd), 0, (LPPOINT)&rc2, 2);
|
MapWindowPoints(GetParent(hwnd), 0, (LPPOINT)&rc2, 2);
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match, window=(%d,%d)-(%d,%d) pos=(%d,%d)-(%d,%d)\n",
|
ok(EqualRect(&rc1, &rc2), "rects do not match, window=%s pos=%s\n",
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom,
|
wine_dbgstr_rect(&rc1), wine_dbgstr_rect(&rc2));
|
||||||
rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
GetWindowRect(hwnd, &rc1);
|
GetWindowRect(hwnd, &rc1);
|
||||||
GetClientRect(hwnd, &rc2);
|
GetClientRect(hwnd, &rc2);
|
||||||
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc1);
|
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc1);
|
||||||
MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
|
MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match, window=(%d,%d)-(%d,%d) client=(%d,%d)-(%d,%d)\n",
|
ok(EqualRect(&rc1, &rc2), "rects do not match, window=%s client=%s\n",
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom,
|
wine_dbgstr_rect(&rc1), wine_dbgstr_rect(&rc2));
|
||||||
rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
}
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case WM_WINDOWPOSCHANGING:
|
case WM_WINDOWPOSCHANGING:
|
||||||
|
@ -2007,11 +2000,11 @@ static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPA
|
||||||
RECT rc1, rc2;
|
RECT rc1, rc2;
|
||||||
|
|
||||||
GetWindowRect(hwnd, &rc1);
|
GetWindowRect(hwnd, &rc1);
|
||||||
trace("window: (%d,%d)-(%d,%d)\n", rc1.left, rc1.top, rc1.right, rc1.bottom);
|
trace("window: %s\n", wine_dbgstr_rect(&rc1));
|
||||||
SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
|
SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
|
||||||
/* note: winpos coordinates are relative to parent */
|
/* note: winpos coordinates are relative to parent */
|
||||||
MapWindowPoints(GetParent(hwnd), 0, (LPPOINT)&rc2, 2);
|
MapWindowPoints(GetParent(hwnd), 0, (LPPOINT)&rc2, 2);
|
||||||
trace("pos: (%d,%d)-(%d,%d)\n", rc2.left, rc2.top, rc2.right, rc2.bottom);
|
trace("pos: %s\n", wine_dbgstr_rect(&rc2));
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match\n");
|
ok(EqualRect(&rc1, &rc2), "rects do not match\n");
|
||||||
|
|
||||||
GetWindowRect(hwnd, &rc1);
|
GetWindowRect(hwnd, &rc1);
|
||||||
|
@ -2366,12 +2359,12 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
|
||||||
SetRect(&rect, 111, 222, 333, 444);
|
SetRect(&rect, 111, 222, 333, 444);
|
||||||
ok(!GetWindowRect(0, &rect), "GetWindowRect succeeded\n");
|
ok(!GetWindowRect(0, &rect), "GetWindowRect succeeded\n");
|
||||||
ok(rect.left == 111 && rect.top == 222 && rect.right == 333 && rect.bottom == 444,
|
ok(rect.left == 111 && rect.top == 222 && rect.right == 333 && rect.bottom == 444,
|
||||||
"wrong window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
"wrong window rect %s\n", wine_dbgstr_rect(&rect));
|
||||||
|
|
||||||
SetRect(&rect, 111, 222, 333, 444);
|
SetRect(&rect, 111, 222, 333, 444);
|
||||||
ok(!GetClientRect(0, &rect), "GetClientRect succeeded\n");
|
ok(!GetClientRect(0, &rect), "GetClientRect succeeded\n");
|
||||||
ok(rect.left == 111 && rect.top == 222 && rect.right == 333 && rect.bottom == 444,
|
ok(rect.left == 111 && rect.top == 222 && rect.right == 333 && rect.bottom == 444,
|
||||||
"wrong window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
"wrong window rect %s\n", wine_dbgstr_rect(&rect));
|
||||||
|
|
||||||
GetWindowRect(hwnd, &orig_win_rc);
|
GetWindowRect(hwnd, &orig_win_rc);
|
||||||
|
|
||||||
|
@ -2380,21 +2373,21 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
|
||||||
ok(ret, "Got %d\n", ret);
|
ok(ret, "Got %d\n", ret);
|
||||||
GetWindowRect( hwnd, &rect );
|
GetWindowRect( hwnd, &rect );
|
||||||
ok( rect.left == 100 && rect.top == 100 && rect.right == 100 && rect.bottom == 100,
|
ok( rect.left == 100 && rect.top == 100 && rect.right == 100 && rect.bottom == 100,
|
||||||
"invalid window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
"invalid window rect %s\n", wine_dbgstr_rect(&rect));
|
||||||
GetClientRect( hwnd, &rect );
|
GetClientRect( hwnd, &rect );
|
||||||
MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
|
MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
|
||||||
ok( rect.left == 90 && rect.top == 90 && rect.right == 110 && rect.bottom == 110,
|
ok( rect.left == 90 && rect.top == 90 && rect.right == 110 && rect.bottom == 110,
|
||||||
"invalid client rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
"invalid client rect %s\n", wine_dbgstr_rect(&rect));
|
||||||
|
|
||||||
ret = SetWindowPos(hwnd, 0, 200, 200, 0, 0, SWP_NOZORDER|SWP_FRAMECHANGED);
|
ret = SetWindowPos(hwnd, 0, 200, 200, 0, 0, SWP_NOZORDER|SWP_FRAMECHANGED);
|
||||||
ok(ret, "Got %d\n", ret);
|
ok(ret, "Got %d\n", ret);
|
||||||
GetWindowRect( hwnd, &rect );
|
GetWindowRect( hwnd, &rect );
|
||||||
ok( rect.left == 200 && rect.top == 200 && rect.right == 200 && rect.bottom == 200,
|
ok( rect.left == 200 && rect.top == 200 && rect.right == 200 && rect.bottom == 200,
|
||||||
"invalid window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
"invalid window rect %s\n", wine_dbgstr_rect(&rect));
|
||||||
GetClientRect( hwnd, &rect );
|
GetClientRect( hwnd, &rect );
|
||||||
MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
|
MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
|
||||||
ok( rect.left == 210 && rect.top == 210 && rect.right == 190 && rect.bottom == 190,
|
ok( rect.left == 210 && rect.top == 210 && rect.right == 190 && rect.bottom == 190,
|
||||||
"invalid client rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
"invalid client rect %s\n", wine_dbgstr_rect(&rect));
|
||||||
|
|
||||||
ret = SetWindowPos(hwnd, 0, orig_win_rc.left, orig_win_rc.top,
|
ret = SetWindowPos(hwnd, 0, orig_win_rc.left, orig_win_rc.top,
|
||||||
orig_win_rc.right, orig_win_rc.bottom, 0);
|
orig_win_rc.right, orig_win_rc.bottom, 0);
|
||||||
|
@ -2461,8 +2454,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
|
||||||
ret = SetWindowPos(hwnd_child, hwnd2 , 1, 2, 3, 4, 0);
|
ret = SetWindowPos(hwnd_child, hwnd2 , 1, 2, 3, 4, 0);
|
||||||
ok(ret, "Got %d\n", ret);
|
ok(ret, "Got %d\n", ret);
|
||||||
GetWindowRect(hwnd_child, &rc2);
|
GetWindowRect(hwnd_child, &rc2);
|
||||||
ok(EqualRect(&rc1, &rc2), "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
|
ok(EqualRect(&rc1, &rc2), "%s != %s\n", wine_dbgstr_rect(&rc1), wine_dbgstr_rect(&rc2));
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
check_active_state(hwnd2, hwnd2, hwnd2);
|
check_active_state(hwnd2, hwnd2, hwnd2);
|
||||||
|
|
||||||
/* Same thing the other way around. */
|
/* Same thing the other way around. */
|
||||||
|
@ -2470,8 +2462,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
|
||||||
ret = SetWindowPos(hwnd2, hwnd_child, 1, 2, 3, 4, 0);
|
ret = SetWindowPos(hwnd2, hwnd_child, 1, 2, 3, 4, 0);
|
||||||
ok(ret, "Got %d\n", ret);
|
ok(ret, "Got %d\n", ret);
|
||||||
GetWindowRect(hwnd2, &rc2);
|
GetWindowRect(hwnd2, &rc2);
|
||||||
ok(EqualRect(&rc1, &rc2), "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
|
ok(EqualRect(&rc1, &rc2), "%s != %s\n", wine_dbgstr_rect(&rc1), wine_dbgstr_rect(&rc2));
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
check_active_state(hwnd2, hwnd2, hwnd2);
|
check_active_state(hwnd2, hwnd2, hwnd2);
|
||||||
|
|
||||||
/* .. and with these windows. */
|
/* .. and with these windows. */
|
||||||
|
@ -2479,8 +2470,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
|
||||||
ret = SetWindowPos(hwnd_grandchild, hwnd_child2, 1, 2, 3, 4, 0);
|
ret = SetWindowPos(hwnd_grandchild, hwnd_child2, 1, 2, 3, 4, 0);
|
||||||
ok(ret, "Got %d\n", ret);
|
ok(ret, "Got %d\n", ret);
|
||||||
GetWindowRect(hwnd_grandchild, &rc2);
|
GetWindowRect(hwnd_grandchild, &rc2);
|
||||||
ok(EqualRect(&rc1, &rc2), "(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
|
ok(EqualRect(&rc1, &rc2), "%s != %s\n", wine_dbgstr_rect(&rc1), wine_dbgstr_rect(&rc2));
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
check_active_state(hwnd2, hwnd2, hwnd2);
|
check_active_state(hwnd2, hwnd2, hwnd2);
|
||||||
|
|
||||||
/* Add SWP_NOZORDER and it will be properly resized. */
|
/* Add SWP_NOZORDER and it will be properly resized. */
|
||||||
|
@ -2490,8 +2480,8 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
|
||||||
GetWindowRect(hwnd_grandchild, &rc2);
|
GetWindowRect(hwnd_grandchild, &rc2);
|
||||||
ok((rc1.left+1) == rc2.left && (rc1.top+2) == rc2.top &&
|
ok((rc1.left+1) == rc2.left && (rc1.top+2) == rc2.top &&
|
||||||
(rc1.left+4) == rc2.right && (rc1.top+6) == rc2.bottom,
|
(rc1.left+4) == rc2.right && (rc1.top+6) == rc2.bottom,
|
||||||
"(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
|
"(%d,%d)-(%d,%d) != %s\n", rc1.left+1, rc1.top+2, rc1.left+4, rc1.top+6,
|
||||||
rc1.left+1, rc1.top+2, rc1.left+4, rc1.top+6, rc2.left, rc2.top, rc2.right, rc2.bottom);
|
wine_dbgstr_rect(&rc2));
|
||||||
check_active_state(hwnd2, hwnd2, hwnd2);
|
check_active_state(hwnd2, hwnd2, hwnd2);
|
||||||
|
|
||||||
/* Given a sibling window, the window is properly resized. */
|
/* Given a sibling window, the window is properly resized. */
|
||||||
|
@ -2501,8 +2491,8 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
|
||||||
GetWindowRect(hwnd_child, &rc2);
|
GetWindowRect(hwnd_child, &rc2);
|
||||||
ok((rc1.left+1) == rc2.left && (rc1.top+2) == rc2.top &&
|
ok((rc1.left+1) == rc2.left && (rc1.top+2) == rc2.top &&
|
||||||
(rc1.left+4) == rc2.right && (rc1.top+6) == rc2.bottom,
|
(rc1.left+4) == rc2.right && (rc1.top+6) == rc2.bottom,
|
||||||
"(%d, %d, %d, %d) != (%d, %d, %d, %d)\n",
|
"(%d,%d)-(%d,%d) != %s\n", rc1.left+1, rc1.top+2, rc1.left+4, rc1.top+6,
|
||||||
rc1.left+1, rc1.top+2, rc1.left+4, rc1.top+6, rc2.left, rc2.top, rc2.right, rc2.bottom);
|
wine_dbgstr_rect(&rc2));
|
||||||
check_active_state(hwnd2, hwnd2, hwnd2);
|
check_active_state(hwnd2, hwnd2, hwnd2);
|
||||||
|
|
||||||
/* Involving the desktop window changes things. */
|
/* Involving the desktop window changes things. */
|
||||||
|
@ -2869,8 +2859,8 @@ static void test_vis_rgn( HWND hwnd )
|
||||||
trace("win9x, mapping to screen coords\n");
|
trace("win9x, mapping to screen coords\n");
|
||||||
MapWindowPoints( hwnd, 0, (POINT *)&rgn_rect, 2 );
|
MapWindowPoints( hwnd, 0, (POINT *)&rgn_rect, 2 );
|
||||||
}
|
}
|
||||||
trace("win: %d,%d-%d,%d\n", win_rect.left, win_rect.top, win_rect.right, win_rect.bottom );
|
trace("win: %s\n", wine_dbgstr_rect(&win_rect));
|
||||||
trace("rgn: %d,%d-%d,%d\n", rgn_rect.left, rgn_rect.top, rgn_rect.right, rgn_rect.bottom );
|
trace("rgn: %s\n", wine_dbgstr_rect(&rgn_rect));
|
||||||
ok( win_rect.left <= rgn_rect.left, "rgn left %d not inside win rect %d\n",
|
ok( win_rect.left <= rgn_rect.left, "rgn left %d not inside win rect %d\n",
|
||||||
rgn_rect.left, win_rect.left );
|
rgn_rect.left, win_rect.left );
|
||||||
ok( win_rect.top <= rgn_rect.top, "rgn top %d not inside win rect %d\n",
|
ok( win_rect.top <= rgn_rect.top, "rgn top %d not inside win rect %d\n",
|
||||||
|
@ -3617,7 +3607,7 @@ static void test_mouse_input(HWND hwnd)
|
||||||
SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
|
SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
|
||||||
|
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
trace("main window %p: (%d,%d)-(%d,%d)\n", hwnd, rc.left, rc.top, rc.right, rc.bottom);
|
trace("main window %p: %s\n", hwnd, wine_dbgstr_rect(&rc));
|
||||||
|
|
||||||
popup = CreateWindowExA(0, "MainWindowClass", NULL, WS_POPUP,
|
popup = CreateWindowExA(0, "MainWindowClass", NULL, WS_POPUP,
|
||||||
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top,
|
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top,
|
||||||
|
@ -3628,7 +3618,7 @@ static void test_mouse_input(HWND hwnd)
|
||||||
SetWindowPos( popup, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
|
SetWindowPos( popup, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
|
||||||
|
|
||||||
GetWindowRect(popup, &rc);
|
GetWindowRect(popup, &rc);
|
||||||
trace("popup window %p: (%d,%d)-(%d,%d)\n", popup, rc.left, rc.top, rc.right, rc.bottom);
|
trace("popup window %p: %s\n", popup, wine_dbgstr_rect(&rc));
|
||||||
|
|
||||||
x = rc.left + (rc.right - rc.left) / 2;
|
x = rc.left + (rc.right - rc.left) / 2;
|
||||||
y = rc.top + (rc.bottom - rc.top) / 2;
|
y = rc.top + (rc.bottom - rc.top) / 2;
|
||||||
|
@ -3824,8 +3814,7 @@ static void test_validatergn(HWND hwnd)
|
||||||
ret = GetUpdateRect( child, &rc2, 0);
|
ret = GetUpdateRect( child, &rc2, 0);
|
||||||
ok( !ret, "Expected GetUpdateRect to return zero, got %d\n", ret);
|
ok( !ret, "Expected GetUpdateRect to return zero, got %d\n", ret);
|
||||||
ok( rc2.left == 0 && rc2.top == 0 && rc2.right == 0 && rc2.bottom == 0,
|
ok( rc2.left == 0 && rc2.top == 0 && rc2.right == 0 && rc2.bottom == 0,
|
||||||
"Update rectangle %d,%d-%d,%d is not empty!\n", rc2.left, rc2.top,
|
"Update rectangle %s is not empty!\n", wine_dbgstr_rect(&rc2));
|
||||||
rc2.right, rc2.bottom);
|
|
||||||
|
|
||||||
/* now test ValidateRgn */
|
/* now test ValidateRgn */
|
||||||
InvalidateRect( child, NULL, 1);
|
InvalidateRect( child, NULL, 1);
|
||||||
|
@ -3836,8 +3825,7 @@ static void test_validatergn(HWND hwnd)
|
||||||
ret = GetUpdateRect( child, &rc2, 0);
|
ret = GetUpdateRect( child, &rc2, 0);
|
||||||
ok( !ret, "Expected GetUpdateRect to return zero, got %d\n", ret);
|
ok( !ret, "Expected GetUpdateRect to return zero, got %d\n", ret);
|
||||||
ok( rc2.left == 0 && rc2.top == 0 && rc2.right == 0 && rc2.bottom == 0,
|
ok( rc2.left == 0 && rc2.top == 0 && rc2.right == 0 && rc2.bottom == 0,
|
||||||
"Update rectangle %d,%d-%d,%d is not empty!\n", rc2.left, rc2.top,
|
"Update rectangle %s is not empty!\n", wine_dbgstr_rect(&rc2));
|
||||||
rc2.right, rc2.bottom);
|
|
||||||
|
|
||||||
DeleteObject( rgn);
|
DeleteObject( rgn);
|
||||||
DestroyWindow( child );
|
DestroyWindow( child );
|
||||||
|
@ -3850,8 +3838,7 @@ static void nccalchelper(HWND hwnd, INT x, INT y, RECT *prc)
|
||||||
GetWindowRect( hwnd, prc);
|
GetWindowRect( hwnd, prc);
|
||||||
rc = *prc;
|
rc = *prc;
|
||||||
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)prc);
|
DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)prc);
|
||||||
trace("window rect is %d,%d - %d,%d, nccalc rect is %d,%d - %d,%d\n",
|
trace("window rect is %s, nccalc rect is %s\n", wine_dbgstr_rect(&rc), wine_dbgstr_rect(prc));
|
||||||
rc.left,rc.top,rc.right,rc.bottom, prc->left,prc->top,prc->right,prc->bottom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_nccalcscroll(HWND parent)
|
static void test_nccalcscroll(HWND parent)
|
||||||
|
@ -3867,30 +3854,28 @@ static void test_nccalcscroll(HWND parent)
|
||||||
|
|
||||||
/* test window too low for a horizontal scroll bar */
|
/* test window too low for a horizontal scroll bar */
|
||||||
nccalchelper( hwnd, 100, sbheight, &rc1);
|
nccalchelper( hwnd, 100, sbheight, &rc1);
|
||||||
ok( rc1.bottom - rc1.top == sbheight, "Height should be %d size is %d,%d - %d,%d\n",
|
ok( rc1.bottom - rc1.top == sbheight, "Height should be %d size is %s\n", sbheight,
|
||||||
sbheight, rc1.left, rc1.top, rc1.right, rc1.bottom);
|
wine_dbgstr_rect(&rc1));
|
||||||
|
|
||||||
/* test window just high enough for a horizontal scroll bar */
|
/* test window just high enough for a horizontal scroll bar */
|
||||||
nccalchelper( hwnd, 100, sbheight + 1, &rc1);
|
nccalchelper( hwnd, 100, sbheight + 1, &rc1);
|
||||||
ok( rc1.bottom - rc1.top == 1, "Height should be %d size is %d,%d - %d,%d\n",
|
ok( rc1.bottom - rc1.top == 1, "Height should be 1 size is %s\n", wine_dbgstr_rect(&rc1));
|
||||||
1, rc1.left, rc1.top, rc1.right, rc1.bottom);
|
|
||||||
|
|
||||||
/* test window too narrow for a vertical scroll bar */
|
/* test window too narrow for a vertical scroll bar */
|
||||||
nccalchelper( hwnd, sbwidth - 1, 100, &rc1);
|
nccalchelper( hwnd, sbwidth - 1, 100, &rc1);
|
||||||
ok( rc1.right - rc1.left == sbwidth - 1 , "Width should be %d size is %d,%d - %d,%d\n",
|
ok( rc1.right - rc1.left == sbwidth - 1 , "Width should be %d size is %s\n", sbwidth - 1,
|
||||||
sbwidth - 1, rc1.left, rc1.top, rc1.right, rc1.bottom);
|
wine_dbgstr_rect(&rc1));
|
||||||
|
|
||||||
/* test window just wide enough for a vertical scroll bar */
|
/* test window just wide enough for a vertical scroll bar */
|
||||||
nccalchelper( hwnd, sbwidth, 100, &rc1);
|
nccalchelper( hwnd, sbwidth, 100, &rc1);
|
||||||
ok( rc1.right - rc1.left == 0, "Width should be %d size is %d,%d - %d,%d\n",
|
ok( rc1.right - rc1.left == 0, "Width should be 0 size is %s\n", wine_dbgstr_rect(&rc1));
|
||||||
0, rc1.left, rc1.top, rc1.right, rc1.bottom);
|
|
||||||
|
|
||||||
/* same test, but with client edge: not enough width */
|
/* same test, but with client edge: not enough width */
|
||||||
SetWindowLongA( hwnd, GWL_EXSTYLE, WS_EX_CLIENTEDGE | GetWindowLongA( hwnd, GWL_EXSTYLE));
|
SetWindowLongA( hwnd, GWL_EXSTYLE, WS_EX_CLIENTEDGE | GetWindowLongA( hwnd, GWL_EXSTYLE));
|
||||||
nccalchelper( hwnd, sbwidth, 100, &rc1);
|
nccalchelper( hwnd, sbwidth, 100, &rc1);
|
||||||
ok( rc1.right - rc1.left == sbwidth - 2 * GetSystemMetrics(SM_CXEDGE),
|
ok( rc1.right - rc1.left == sbwidth - 2 * GetSystemMetrics(SM_CXEDGE),
|
||||||
"Width should be %d size is %d,%d - %d,%d\n",
|
"Width should be %d size is %s\n", sbwidth - 2 * GetSystemMetrics(SM_CXEDGE),
|
||||||
sbwidth - 2 * GetSystemMetrics(SM_CXEDGE), rc1.left, rc1.top, rc1.right, rc1.bottom);
|
wine_dbgstr_rect(&rc1));
|
||||||
|
|
||||||
DestroyWindow( hwnd);
|
DestroyWindow( hwnd);
|
||||||
}
|
}
|
||||||
|
@ -4816,8 +4801,7 @@ static void test_scrollvalidate( HWND parent)
|
||||||
SetRectRgn( tmprgn, 0,93,98,98);
|
SetRectRgn( tmprgn, 0,93,98,98);
|
||||||
CombineRgn( exprgn, exprgn, tmprgn, RGN_OR);
|
CombineRgn( exprgn, exprgn, tmprgn, RGN_OR);
|
||||||
ok( EqualRgn( exprgn, hrgn), "wrong update region\n");
|
ok( EqualRgn( exprgn, hrgn), "wrong update region\n");
|
||||||
trace("update rect is %d,%d - %d,%d\n",
|
trace("update rect is %s\n", wine_dbgstr_rect(&rcu));
|
||||||
rcu.left,rcu.top,rcu.right,rcu.bottom);
|
|
||||||
/* now with clipping region */
|
/* now with clipping region */
|
||||||
SelectClipRgn( hdc, clipping);
|
SelectClipRgn( hdc, clipping);
|
||||||
ScrollDC( hdc, -10, -5, &rc, &cliprc, hrgn, &rcu);
|
ScrollDC( hdc, -10, -5, &rc, &cliprc, hrgn, &rcu);
|
||||||
|
@ -4829,8 +4813,7 @@ static void test_scrollvalidate( HWND parent)
|
||||||
SetRectRgn( tmprgn, 10,85,90,90);
|
SetRectRgn( tmprgn, 10,85,90,90);
|
||||||
CombineRgn( exprgn, exprgn, tmprgn, RGN_OR);
|
CombineRgn( exprgn, exprgn, tmprgn, RGN_OR);
|
||||||
ok( EqualRgn( exprgn, hrgn), "wrong update region\n");
|
ok( EqualRgn( exprgn, hrgn), "wrong update region\n");
|
||||||
trace("update rect is %d,%d - %d,%d\n",
|
trace("update rect is %s\n", wine_dbgstr_rect(&rcu));
|
||||||
rcu.left,rcu.top,rcu.right,rcu.bottom);
|
|
||||||
ReleaseDC( hwnd1, hdc);
|
ReleaseDC( hwnd1, hdc);
|
||||||
|
|
||||||
/* test scrolling a rect by more than its size */
|
/* test scrolling a rect by more than its size */
|
||||||
|
@ -4846,7 +4829,7 @@ static void test_scrollvalidate( HWND parent)
|
||||||
CombineRgn( exprgn, exprgn, tmprgn, RGN_OR);
|
CombineRgn( exprgn, exprgn, tmprgn, RGN_OR);
|
||||||
ok( EqualRgn( exprgn, hrgn), "wrong update region\n");
|
ok( EqualRgn( exprgn, hrgn), "wrong update region\n");
|
||||||
ok( rcu.left == 20 && rcu.top == 40 && rcu.right == 50 && rcu.bottom == 50,
|
ok( rcu.left == 20 && rcu.top == 40 && rcu.right == 50 && rcu.bottom == 50,
|
||||||
"unexpected update rect: %d,%d - %d,%d\n", rcu.left,rcu.top,rcu.right,rcu.bottom);
|
"unexpected update rect: %s\n", wine_dbgstr_rect(&rcu));
|
||||||
|
|
||||||
/* test scrolling a window with an update region */
|
/* test scrolling a window with an update region */
|
||||||
ValidateRect( hwnd1, NULL);
|
ValidateRect( hwnd1, NULL);
|
||||||
|
@ -5013,12 +4996,11 @@ static void test_scrolldc( HWND parent)
|
||||||
/* test with NULL clip rect */
|
/* test with NULL clip rect */
|
||||||
ScrollDC( hdc, 20, -20, &rc, NULL, hrgn, &rcu);
|
ScrollDC( hdc, 20, -20, &rc, NULL, hrgn, &rcu);
|
||||||
/*FillRgn(hdc, hrgn, GetStockObject(WHITE_BRUSH));*/
|
/*FillRgn(hdc, hrgn, GetStockObject(WHITE_BRUSH));*/
|
||||||
trace("update rect: %d,%d - %d,%d\n",
|
trace("update rect: %s\n", wine_dbgstr_rect(&rcu));
|
||||||
rcu.left, rcu.top, rcu.right, rcu.bottom);
|
|
||||||
if (winetest_debug > 0) dump_region(hrgn);
|
if (winetest_debug > 0) dump_region(hrgn);
|
||||||
SetRect(&rc2, 0, 0, 100, 100);
|
SetRect(&rc2, 0, 0, 100, 100);
|
||||||
ok(EqualRect(&rcu, &rc2), "rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)\n",
|
ok(EqualRect(&rcu, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rcu),
|
||||||
rcu.left, rcu.top, rcu.right, rcu.bottom, rc2.left, rc2.top, rc2.right, rc2.bottom);
|
wine_dbgstr_rect(&rc2));
|
||||||
|
|
||||||
SetRectRgn( exprgn, 0, 0, 20, 80);
|
SetRectRgn( exprgn, 0, 0, 20, 80);
|
||||||
SetRectRgn( tmprgn, 0, 80, 100, 100);
|
SetRectRgn( tmprgn, 0, 80, 100, 100);
|
||||||
|
@ -5035,8 +5017,7 @@ static void test_scrolldc( HWND parent)
|
||||||
SetRectRgn( tmprgn, 25, 35, 35, 75);
|
SetRectRgn( tmprgn, 25, 35, 35, 75);
|
||||||
CombineRgn(exprgn, exprgn, tmprgn, RGN_OR);
|
CombineRgn(exprgn, exprgn, tmprgn, RGN_OR);
|
||||||
ok(EqualRgn(exprgn, hrgn), "wrong update region\n");
|
ok(EqualRgn(exprgn, hrgn), "wrong update region\n");
|
||||||
trace("update rect: %d,%d - %d,%d\n",
|
trace("update rect: %s\n", wine_dbgstr_rect(&rcu));
|
||||||
rcu.left, rcu.top, rcu.right, rcu.bottom);
|
|
||||||
if (winetest_debug > 0) dump_region(hrgn);
|
if (winetest_debug > 0) dump_region(hrgn);
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
|
@ -5178,9 +5159,8 @@ static void test_AWR_flags(void)
|
||||||
rect2 = rect;
|
rect2 = rect;
|
||||||
AdjustWindowRectEx( &rect, style, FALSE, exstyle );
|
AdjustWindowRectEx( &rect, style, FALSE, exstyle );
|
||||||
wine_AdjustWindowRectEx( &rect2, style, FALSE, exstyle );
|
wine_AdjustWindowRectEx( &rect2, style, FALSE, exstyle );
|
||||||
ok( EqualRect( &rect, &rect2 ), "rects do not match: win %d,%d-%d,%d wine %d,%d-%d,%d\n",
|
ok( EqualRect( &rect, &rect2 ), "rects do not match: win %s wine %s\n",
|
||||||
rect.left, rect.top, rect.right, rect.bottom,
|
wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &rect2 ));
|
||||||
rect2.left, rect2.top, rect2.right, rect2.bottom );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5300,16 +5280,14 @@ static LRESULT WINAPI parentdc_window_procA(HWND hwnd, UINT msg, WPARAM wparam,
|
||||||
GetClientRect(hwnd, &rc);
|
GetClientRect(hwnd, &rc);
|
||||||
CopyRect(&t->client, &rc);
|
CopyRect(&t->client, &rc);
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
trace("WM_PAINT: hwnd %p, client rect (%d,%d)-(%d,%d), window rect (%d,%d)-(%d,%d)\n", hwnd,
|
trace("WM_PAINT: hwnd %p, client rect %s, window rect %s\n", hwnd,
|
||||||
t->client.left, t->client.top, t->client.right, t->client.bottom,
|
wine_dbgstr_rect(&t->client), wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
BeginPaint(hwnd, &ps);
|
BeginPaint(hwnd, &ps);
|
||||||
CopyRect(&t->paint, &ps.rcPaint);
|
CopyRect(&t->paint, &ps.rcPaint);
|
||||||
GetClipBox(ps.hdc, &rc);
|
GetClipBox(ps.hdc, &rc);
|
||||||
CopyRect(&t->clip, &rc);
|
CopyRect(&t->clip, &rc);
|
||||||
trace("clip rect (%d,%d)-(%d,%d), paint rect (%d,%d)-(%d,%d)\n",
|
trace("clip rect %s, paint rect %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.left, rc.top, rc.right, rc.bottom,
|
wine_dbgstr_rect(&ps.rcPaint));
|
||||||
ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom);
|
|
||||||
EndPaint(hwnd, &ps);
|
EndPaint(hwnd, &ps);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5676,8 +5654,8 @@ static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
GetWindowRect( hwnd, &rect );
|
GetWindowRect( hwnd, &rect );
|
||||||
ok( !rect.left && !rect.top && !rect.right && !rect.bottom,
|
ok( !rect.left && !rect.top && !rect.right && !rect.bottom, "wrong rect %s\n",
|
||||||
"wrong rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
wine_dbgstr_rect( &rect ));
|
||||||
return DefWindowProcA(hwnd, msg, wp, lp);
|
return DefWindowProcA(hwnd, msg, wp, lp);
|
||||||
}
|
}
|
||||||
case WM_NCCREATE:
|
case WM_NCCREATE:
|
||||||
|
@ -5686,8 +5664,8 @@ static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM
|
||||||
CREATESTRUCTA *cs = (CREATESTRUCTA *)lp;
|
CREATESTRUCTA *cs = (CREATESTRUCTA *)lp;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
GetWindowRect( hwnd, &rect );
|
GetWindowRect( hwnd, &rect );
|
||||||
trace( "hwnd %p msg %x size %dx%d rect %d,%d-%d,%d\n",
|
trace( "hwnd %p msg %x size %dx%d rect %s\n", hwnd, msg, cs->cx, cs->cy,
|
||||||
hwnd, msg, cs->cx, cs->cy, rect.left, rect.top, rect.right, rect.bottom );
|
wine_dbgstr_rect( &rect ));
|
||||||
ok( cs->cx == expected_cx || broken(cs->cx == (short)expected_cx),
|
ok( cs->cx == expected_cx || broken(cs->cx == (short)expected_cx),
|
||||||
"wrong x size %d/%d\n", cs->cx, expected_cx );
|
"wrong x size %d/%d\n", cs->cx, expected_cx );
|
||||||
ok( cs->cy == expected_cy || broken(cs->cy == (short)expected_cy),
|
ok( cs->cy == expected_cy || broken(cs->cy == (short)expected_cy),
|
||||||
|
@ -5700,18 +5678,15 @@ static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM
|
||||||
rect.bottom - rect.top == broken_rect.bottom - broken_rect.top) ||
|
rect.bottom - rect.top == broken_rect.bottom - broken_rect.top) ||
|
||||||
broken( rect.right - rect.left == (short)broken_rect.right - (short)broken_rect.left &&
|
broken( rect.right - rect.left == (short)broken_rect.right - (short)broken_rect.left &&
|
||||||
rect.bottom - rect.top == (short)broken_rect.bottom - (short)broken_rect.top),
|
rect.bottom - rect.top == (short)broken_rect.bottom - (short)broken_rect.top),
|
||||||
"wrong rect %d,%d-%d,%d / %d,%d-%d,%d\n",
|
"wrong rect %s / %s\n", wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &expected_rect ));
|
||||||
rect.left, rect.top, rect.right, rect.bottom,
|
|
||||||
expected_rect.left, expected_rect.top, expected_rect.right, expected_rect.bottom );
|
|
||||||
return DefWindowProcA(hwnd, msg, wp, lp);
|
return DefWindowProcA(hwnd, msg, wp, lp);
|
||||||
}
|
}
|
||||||
case WM_NCCALCSIZE:
|
case WM_NCCALCSIZE:
|
||||||
{
|
{
|
||||||
RECT rect, *r = (RECT *)lp;
|
RECT rect, *r = (RECT *)lp;
|
||||||
GetWindowRect( hwnd, &rect );
|
GetWindowRect( hwnd, &rect );
|
||||||
ok( !memcmp( &rect, r, sizeof(rect) ),
|
ok( EqualRect( &rect, r ), "passed rect %s doesn't match window rect %s\n",
|
||||||
"passed rect %d,%d-%d,%d doesn't match window rect %d,%d-%d,%d\n",
|
wine_dbgstr_rect( r ), wine_dbgstr_rect( &rect ));
|
||||||
r->left, r->top, r->right, r->bottom, rect.left, rect.top, rect.right, rect.bottom );
|
|
||||||
return DefWindowProcA(hwnd, msg, wp, lp);
|
return DefWindowProcA(hwnd, msg, wp, lp);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -5968,7 +5943,7 @@ static void test_CreateWindow(void)
|
||||||
ok(!IsRectEmpty(&rc), "parent client rect is empty\n");
|
ok(!IsRectEmpty(&rc), "parent client rect is empty\n");
|
||||||
|
|
||||||
InflateRect(&rc, 200, 200);
|
InflateRect(&rc, 200, 200);
|
||||||
trace("creating child with rect (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom);
|
trace("creating child with rect %s\n", wine_dbgstr_rect(&rc));
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
hwnd = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME,
|
hwnd = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME,
|
||||||
|
@ -5985,9 +5960,8 @@ static void test_CreateWindow(void)
|
||||||
|
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
OffsetRect(&rc, -rc.left, -rc.top);
|
OffsetRect(&rc, -rc.left, -rc.top);
|
||||||
ok(EqualRect(&rc, &rc_minmax), "rects don't match: (%d,%d-%d,%d) and (%d,%d-%d,%d)\n",
|
ok(EqualRect(&rc, &rc_minmax), "rects don't match: %s and %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.left, rc.top, rc.right, rc.bottom,
|
wine_dbgstr_rect(&rc_minmax));
|
||||||
rc_minmax.left, rc_minmax.top, rc_minmax.right, rc_minmax.bottom);
|
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
cls.lpfnWndProc = winsizes_wnd_proc;
|
cls.lpfnWndProc = winsizes_wnd_proc;
|
||||||
|
@ -6221,9 +6195,8 @@ static void test_ShowWindow(void)
|
||||||
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||||
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
ok(EqualRect(&rcMain, &rc), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n",
|
ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain),
|
||||||
rcMain.left, rcMain.top, rcMain.right, rcMain.bottom,
|
wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
ret = ShowWindow(hwnd, SW_SHOW);
|
ret = ShowWindow(hwnd, SW_SHOW);
|
||||||
ok(!ret, "not expected ret: %lu\n", ret);
|
ok(!ret, "not expected ret: %lu\n", ret);
|
||||||
|
@ -6233,9 +6206,8 @@ static void test_ShowWindow(void)
|
||||||
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||||
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
ok(EqualRect(&rcMain, &rc), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n",
|
ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain),
|
||||||
rcMain.left, rcMain.top, rcMain.right, rcMain.bottom,
|
wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
ret = ShowWindow(hwnd, SW_MINIMIZE);
|
ret = ShowWindow(hwnd, SW_MINIMIZE);
|
||||||
ok(ret, "not expected ret: %lu\n", ret);
|
ok(ret, "not expected ret: %lu\n", ret);
|
||||||
|
@ -6263,9 +6235,8 @@ static void test_ShowWindow(void)
|
||||||
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||||
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
ok(EqualRect(&rcMain, &rc), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n",
|
ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain),
|
||||||
rcMain.left, rcMain.top, rcMain.right, rcMain.bottom,
|
wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
ret = EnableWindow(hwnd, FALSE);
|
ret = EnableWindow(hwnd, FALSE);
|
||||||
ok(!ret, "not expected ret: %lu\n", ret);
|
ok(!ret, "not expected ret: %lu\n", ret);
|
||||||
|
@ -6280,9 +6251,8 @@ static void test_ShowWindow(void)
|
||||||
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||||
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
ok(EqualRect(&rcMain, &rc), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n",
|
ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain),
|
||||||
rcMain.left, rcMain.top, rcMain.right, rcMain.bottom,
|
wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
|
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
|
||||||
ok(!ret, "not expected ret: %lu\n", ret);
|
ok(!ret, "not expected ret: %lu\n", ret);
|
||||||
|
@ -6292,9 +6262,8 @@ static void test_ShowWindow(void)
|
||||||
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||||
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
ok(EqualRect(&rcMain, &rc), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n",
|
ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain),
|
||||||
rcMain.left, rcMain.top, rcMain.right, rcMain.bottom,
|
wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
ret = ShowWindow(hwnd, SW_MINIMIZE);
|
ret = ShowWindow(hwnd, SW_MINIMIZE);
|
||||||
ok(ret, "not expected ret: %lu\n", ret);
|
ok(ret, "not expected ret: %lu\n", ret);
|
||||||
|
@ -6324,9 +6293,8 @@ static void test_ShowWindow(void)
|
||||||
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||||
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
ok(EqualRect(&rcMain, &rc), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n",
|
ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain),
|
||||||
rcMain.left, rcMain.top, rcMain.right, rcMain.bottom,
|
wine_dbgstr_rect(&rc));
|
||||||
rc.left, rc.top, rc.right, rc.bottom);
|
|
||||||
|
|
||||||
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
|
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
|
||||||
ok(!ret, "not expected ret: %lu\n", ret);
|
ok(!ret, "not expected ret: %lu\n", ret);
|
||||||
|
@ -6572,16 +6540,14 @@ static void test_GetUpdateRect(void)
|
||||||
SetRectEmpty(&rc2);
|
SetRectEmpty(&rc2);
|
||||||
ret = GetUpdateRect(hgrandparent, &rc1, FALSE);
|
ret = GetUpdateRect(hgrandparent, &rc1, FALSE);
|
||||||
ok(!ret, "GetUpdateRect returned not empty region\n");
|
ok(!ret, "GetUpdateRect returned not empty region\n");
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d,%d,%d) / (%d,%d,%d,%d)\n",
|
ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom,
|
wine_dbgstr_rect(&rc2));
|
||||||
rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
|
|
||||||
SetRect(&rc2, 10, 10, 40, 40);
|
SetRect(&rc2, 10, 10, 40, 40);
|
||||||
ret = GetUpdateRect(hparent, &rc1, FALSE);
|
ret = GetUpdateRect(hparent, &rc1, FALSE);
|
||||||
ok(ret, "GetUpdateRect returned empty region\n");
|
ok(ret, "GetUpdateRect returned empty region\n");
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d,%d,%d) / (%d,%d,%d,%d)\n",
|
ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom,
|
wine_dbgstr_rect(&rc2));
|
||||||
rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
|
|
||||||
parent_wm_paint = FALSE;
|
parent_wm_paint = FALSE;
|
||||||
grandparent_wm_paint = FALSE;
|
grandparent_wm_paint = FALSE;
|
||||||
|
@ -6636,16 +6602,14 @@ static void test_GetUpdateRect(void)
|
||||||
SetRectEmpty(&rc2);
|
SetRectEmpty(&rc2);
|
||||||
ret = GetUpdateRect(hgrandparent, &rc1, FALSE);
|
ret = GetUpdateRect(hgrandparent, &rc1, FALSE);
|
||||||
ok(!ret, "GetUpdateRect returned not empty region\n");
|
ok(!ret, "GetUpdateRect returned not empty region\n");
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d,%d,%d) / (%d,%d,%d,%d)\n",
|
ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom,
|
wine_dbgstr_rect(&rc2));
|
||||||
rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
|
|
||||||
SetRect(&rc2, 10, 10, 40, 40);
|
SetRect(&rc2, 10, 10, 40, 40);
|
||||||
ret = GetUpdateRect(hparent, &rc1, FALSE);
|
ret = GetUpdateRect(hparent, &rc1, FALSE);
|
||||||
ok(ret, "GetUpdateRect returned empty region\n");
|
ok(ret, "GetUpdateRect returned empty region\n");
|
||||||
ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d,%d,%d) / (%d,%d,%d,%d)\n",
|
ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
|
||||||
rc1.left, rc1.top, rc1.right, rc1.bottom,
|
wine_dbgstr_rect(&rc2));
|
||||||
rc2.left, rc2.top, rc2.right, rc2.bottom);
|
|
||||||
|
|
||||||
parent_wm_paint = FALSE;
|
parent_wm_paint = FALSE;
|
||||||
grandparent_wm_paint = FALSE;
|
grandparent_wm_paint = FALSE;
|
||||||
|
@ -6918,11 +6882,11 @@ static void test_hwnd_message(void)
|
||||||
ok( !lstrcmpiA( buffer, "Message" ), "wrong parent class '%s'\n", buffer );
|
ok( !lstrcmpiA( buffer, "Message" ), "wrong parent class '%s'\n", buffer );
|
||||||
GetWindowRect( parent, &rect );
|
GetWindowRect( parent, &rect );
|
||||||
ok( rect.left == 0 && rect.right == 100 && rect.top == 0 && rect.bottom == 100,
|
ok( rect.left == 0 && rect.right == 100 && rect.top == 0 && rect.bottom == 100,
|
||||||
"wrong parent rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
"wrong parent rect %s\n", wine_dbgstr_rect( &rect ));
|
||||||
}
|
}
|
||||||
GetWindowRect( hwnd, &rect );
|
GetWindowRect( hwnd, &rect );
|
||||||
ok( rect.left == 100 && rect.right == 300 && rect.top == 100 && rect.bottom == 300,
|
ok( rect.left == 100 && rect.right == 300 && rect.top == 100 && rect.bottom == 300,
|
||||||
"wrong window rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
|
"wrong window rect %s\n", wine_dbgstr_rect( &rect ));
|
||||||
|
|
||||||
/* test FindWindow behavior */
|
/* test FindWindow behavior */
|
||||||
|
|
||||||
|
@ -7116,8 +7080,7 @@ static LRESULT CALLBACK fullscreen_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPAR
|
||||||
CREATESTRUCTA *cs = (CREATESTRUCTA *)lp;
|
CREATESTRUCTA *cs = (CREATESTRUCTA *)lp;
|
||||||
ok(cs->x == mi.rcMonitor.left && cs->y == mi.rcMonitor.top &&
|
ok(cs->x == mi.rcMonitor.left && cs->y == mi.rcMonitor.top &&
|
||||||
cs->cx == mi.rcMonitor.right && cs->cy == mi.rcMonitor.bottom,
|
cs->cx == mi.rcMonitor.right && cs->cy == mi.rcMonitor.bottom,
|
||||||
"expected %d,%d-%d,%d, got %d,%d-%d,%d\n",
|
"expected %s, got (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&mi.rcMonitor),
|
||||||
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
|
|
||||||
cs->x, cs->y, cs->cx, cs->cy);
|
cs->x, cs->y, cs->cx, cs->cy);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -7165,9 +7128,7 @@ static void test_fullscreen(void)
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = pGetMonitorInfoA(hmon, &mi);
|
ret = pGetMonitorInfoA(hmon, &mi);
|
||||||
ok(ret, "GetMonitorInfo error %u\n", GetLastError());
|
ok(ret, "GetMonitorInfo error %u\n", GetLastError());
|
||||||
trace("monitor (%d,%d-%d,%d), work (%d,%d-%d,%d)\n",
|
trace("monitor %s, work %s\n", wine_dbgstr_rect(&mi.rcMonitor), wine_dbgstr_rect(&mi.rcWork));
|
||||||
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom,
|
|
||||||
mi.rcWork.left, mi.rcWork.top, mi.rcWork.right, mi.rcWork.bottom);
|
|
||||||
|
|
||||||
cls.style = 0;
|
cls.style = 0;
|
||||||
cls.lpfnWndProc = fullscreen_wnd_proc;
|
cls.lpfnWndProc = fullscreen_wnd_proc;
|
||||||
|
@ -7200,10 +7161,10 @@ static void test_fullscreen(void)
|
||||||
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
||||||
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
trace("%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
||||||
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
||||||
"%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
"%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
style = t_style[i] | WS_MAXIMIZE;
|
style = t_style[i] | WS_MAXIMIZE;
|
||||||
|
@ -7212,10 +7173,10 @@ static void test_fullscreen(void)
|
||||||
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
||||||
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
trace("%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
||||||
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
||||||
"%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
"%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
style = t_style[i] | WS_MAXIMIZE | WS_CAPTION;
|
style = t_style[i] | WS_MAXIMIZE | WS_CAPTION;
|
||||||
|
@ -7224,10 +7185,10 @@ static void test_fullscreen(void)
|
||||||
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
||||||
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
trace("%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
||||||
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
||||||
"%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
"%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
style = t_style[i] | WS_CAPTION | WS_MAXIMIZEBOX;
|
style = t_style[i] | WS_CAPTION | WS_MAXIMIZEBOX;
|
||||||
|
@ -7236,10 +7197,10 @@ static void test_fullscreen(void)
|
||||||
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
||||||
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
trace("%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
||||||
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
||||||
"%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
"%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
style = t_style[i] | WS_MAXIMIZE | WS_CAPTION | WS_MAXIMIZEBOX;
|
style = t_style[i] | WS_MAXIMIZE | WS_CAPTION | WS_MAXIMIZEBOX;
|
||||||
|
@ -7248,15 +7209,14 @@ static void test_fullscreen(void)
|
||||||
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
||||||
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
trace("%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
/* Windows makes a maximized window slightly larger (to hide the borders?) */
|
/* Windows makes a maximized window slightly larger (to hide the borders?) */
|
||||||
fixup = min(abs(rc.left), abs(rc.top));
|
fixup = min(abs(rc.left), abs(rc.top));
|
||||||
InflateRect(&rc, -fixup, -fixup);
|
InflateRect(&rc, -fixup, -fixup);
|
||||||
ok(rc.left >= mi.rcMonitor.left && rc.top >= mi.rcMonitor.top &&
|
ok(rc.left >= mi.rcMonitor.left && rc.top >= mi.rcMonitor.top &&
|
||||||
rc.right <= mi.rcMonitor.right && rc.bottom <= mi.rcMonitor.bottom,
|
rc.right <= mi.rcMonitor.right && rc.bottom <= mi.rcMonitor.bottom,
|
||||||
"%#x/%#x: window rect %d,%d-%d,%d must be in %d,%d-%d,%d\n",
|
"%#x/%#x: window rect %s must be in %s\n", ex_style, style, wine_dbgstr_rect(&rc),
|
||||||
ex_style, style, rc.left, rc.top, rc.right, rc.bottom,
|
wine_dbgstr_rect(&mi.rcMonitor));
|
||||||
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom);
|
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
style = t_style[i] | WS_MAXIMIZE | WS_MAXIMIZEBOX;
|
style = t_style[i] | WS_MAXIMIZE | WS_MAXIMIZEBOX;
|
||||||
|
@ -7265,18 +7225,18 @@ static void test_fullscreen(void)
|
||||||
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL);
|
||||||
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style);
|
||||||
GetWindowRect(hwnd, &rc);
|
GetWindowRect(hwnd, &rc);
|
||||||
trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
trace("%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
/* Windows makes a maximized window slightly larger (to hide the borders?) */
|
/* Windows makes a maximized window slightly larger (to hide the borders?) */
|
||||||
fixup = min(abs(rc.left), abs(rc.top));
|
fixup = min(abs(rc.left), abs(rc.top));
|
||||||
InflateRect(&rc, -fixup, -fixup);
|
InflateRect(&rc, -fixup, -fixup);
|
||||||
if (style & (WS_CHILD | WS_POPUP))
|
if (style & (WS_CHILD | WS_POPUP))
|
||||||
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
ok(rc.left <= mi.rcMonitor.left && rc.top <= mi.rcMonitor.top &&
|
||||||
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
rc.right >= mi.rcMonitor.right && rc.bottom >= mi.rcMonitor.bottom,
|
||||||
"%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
"%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
else
|
else
|
||||||
ok(rc.left >= mi.rcMonitor.left && rc.top >= mi.rcMonitor.top &&
|
ok(rc.left >= mi.rcMonitor.left && rc.top >= mi.rcMonitor.top &&
|
||||||
rc.right <= mi.rcMonitor.right && rc.bottom <= mi.rcMonitor.bottom,
|
rc.right <= mi.rcMonitor.right && rc.bottom <= mi.rcMonitor.bottom,
|
||||||
"%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom);
|
"%#x/%#x: window rect %s\n", ex_style, style, wine_dbgstr_rect(&rc));
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7586,8 +7546,7 @@ static void test_winregion(void)
|
||||||
ret = pGetWindowRgnBox(hwnd, &r);
|
ret = pGetWindowRgnBox(hwnd, &r);
|
||||||
ok( ret == SIMPLEREGION, "Expected SIMPLEREGION, got %d\n", ret);
|
ok( ret == SIMPLEREGION, "Expected SIMPLEREGION, got %d\n", ret);
|
||||||
ok( r.left == 2 && r.top == 3 && r.right == 10 && r.bottom == 15,
|
ok( r.left == 2 && r.top == 3 && r.right == 10 && r.bottom == 15,
|
||||||
"Expected (2,3,10,15), got (%d,%d,%d,%d)\n", r.left, r.top,
|
"Expected (2,3)-(10,15), got %s\n", wine_dbgstr_rect( &r ));
|
||||||
r.right, r.bottom);
|
|
||||||
if (pMirrorRgn)
|
if (pMirrorRgn)
|
||||||
{
|
{
|
||||||
hrgn = CreateRectRgn(2, 3, 10, 15);
|
hrgn = CreateRectRgn(2, 3, 10, 15);
|
||||||
|
@ -7600,7 +7559,7 @@ static void test_winregion(void)
|
||||||
ret = GetRgnBox( hrgn, &r );
|
ret = GetRgnBox( hrgn, &r );
|
||||||
ok( ret == SIMPLEREGION, "GetRgnBox failed %u\n", ret );
|
ok( ret == SIMPLEREGION, "GetRgnBox failed %u\n", ret );
|
||||||
ok( r.left == width - 10 && r.top == 3 && r.right == width - 2 && r.bottom == 15,
|
ok( r.left == width - 10 && r.top == 3 && r.right == width - 2 && r.bottom == 15,
|
||||||
"Wrong rectangle (%d,%d,%d,%d) for width %d\n", r.left, r.top, r.right, r.bottom, width );
|
"Wrong rectangle %s for width %d\n", wine_dbgstr_rect( &r ), width );
|
||||||
}
|
}
|
||||||
else win_skip( "MirrorRgn not supported\n" );
|
else win_skip( "MirrorRgn not supported\n" );
|
||||||
}
|
}
|
||||||
|
@ -7623,44 +7582,44 @@ static void test_rtl_layout(void)
|
||||||
child = CreateWindowExA(0, "static", NULL, WS_CHILD, 10, 10, 20, 20, parent, 0, 0, NULL);
|
child = CreateWindowExA(0, "static", NULL, WS_CHILD, 10, 10, 20, 20, parent, 0, 0, NULL);
|
||||||
|
|
||||||
GetWindowRect( parent, &r );
|
GetWindowRect( parent, &r );
|
||||||
ok( r.left == 100 && r.right == 400, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 100 && r.right == 400, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
GetClientRect( parent, &r );
|
GetClientRect( parent, &r );
|
||||||
ok( r.left == 0 && r.right == 300, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 0 && r.right == 300, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
GetClientRect( child, &r );
|
GetClientRect( child, &r );
|
||||||
ok( r.left == 0 && r.right == 20, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 0 && r.right == 20, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
MapWindowPoints( child, parent, (POINT *)&r, 2 );
|
MapWindowPoints( child, parent, (POINT *)&r, 2 );
|
||||||
ok( r.left == 10 && r.right == 30, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 10 && r.right == 30, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
GetWindowRect( child, &r );
|
GetWindowRect( child, &r );
|
||||||
ok( r.left == 370 && r.right == 390, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 370 && r.right == 390, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
MapWindowPoints( NULL, parent, (POINT *)&r, 2 );
|
MapWindowPoints( NULL, parent, (POINT *)&r, 2 );
|
||||||
ok( r.left == 10 && r.right == 30, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 10 && r.right == 30, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
GetWindowRect( child, &r );
|
GetWindowRect( child, &r );
|
||||||
MapWindowPoints( NULL, parent, (POINT *)&r, 1 );
|
MapWindowPoints( NULL, parent, (POINT *)&r, 1 );
|
||||||
MapWindowPoints( NULL, parent, (POINT *)&r + 1, 1 );
|
MapWindowPoints( NULL, parent, (POINT *)&r + 1, 1 );
|
||||||
ok( r.left == 30 && r.right == 10, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 30 && r.right == 10, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
pt.x = pt.y = 12;
|
pt.x = pt.y = 12;
|
||||||
MapWindowPoints( child, parent, &pt, 1 );
|
MapWindowPoints( child, parent, &pt, 1 );
|
||||||
ok( pt.x == 22 && pt.y == 22, "wrong point %d,%d\n", pt.x, pt.y );
|
ok( pt.x == 22 && pt.y == 22, "wrong point %d,%d\n", pt.x, pt.y );
|
||||||
SetWindowPos( parent, 0, 0, 0, 250, 250, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
|
SetWindowPos( parent, 0, 0, 0, 250, 250, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
|
||||||
GetWindowRect( parent, &r );
|
GetWindowRect( parent, &r );
|
||||||
ok( r.left == 100 && r.right == 350, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 100 && r.right == 350, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
GetWindowRect( child, &r );
|
GetWindowRect( child, &r );
|
||||||
ok( r.left == 320 && r.right == 340, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 320 && r.right == 340, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
SetWindowLongW( parent, GWL_EXSTYLE, 0 );
|
SetWindowLongW( parent, GWL_EXSTYLE, 0 );
|
||||||
GetWindowRect( child, &r );
|
GetWindowRect( child, &r );
|
||||||
ok( r.left == 320 && r.right == 340, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 320 && r.right == 340, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
MapWindowPoints( NULL, parent, (POINT *)&r, 2 );
|
MapWindowPoints( NULL, parent, (POINT *)&r, 2 );
|
||||||
ok( r.left == 220 && r.right == 240, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 220 && r.right == 240, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
SetWindowLongW( parent, GWL_EXSTYLE, WS_EX_LAYOUTRTL );
|
SetWindowLongW( parent, GWL_EXSTYLE, WS_EX_LAYOUTRTL );
|
||||||
GetWindowRect( child, &r );
|
GetWindowRect( child, &r );
|
||||||
ok( r.left == 320 && r.right == 340, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 320 && r.right == 340, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
MapWindowPoints( NULL, parent, (POINT *)&r, 2 );
|
MapWindowPoints( NULL, parent, (POINT *)&r, 2 );
|
||||||
ok( r.left == 10 && r.right == 30, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 10 && r.right == 30, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
SetWindowPos( child, 0, 0, 0, 30, 30, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
|
SetWindowPos( child, 0, 0, 0, 30, 30, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
|
||||||
GetWindowRect( child, &r );
|
GetWindowRect( child, &r );
|
||||||
ok( r.left == 310 && r.right == 340, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 310 && r.right == 340, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
MapWindowPoints( NULL, parent, (POINT *)&r, 2 );
|
MapWindowPoints( NULL, parent, (POINT *)&r, 2 );
|
||||||
ok( r.left == 10 && r.right == 40, "wrong rect %d,%d - %d,%d\n", r.left, r.top, r.right, r.bottom );
|
ok( r.left == 10 && r.right == 40, "wrong rect %s\n", wine_dbgstr_rect( &r ));
|
||||||
DestroyWindow( child );
|
DestroyWindow( child );
|
||||||
DestroyWindow( parent );
|
DestroyWindow( parent );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue