--- cvs/hq/wine/dlls/user32/tests/win.c Thu Nov 16 14:02:18 2006 +++ wine/dlls/user32/tests/win.c Wed Nov 22 04:26:55 2006 @@ -3696,6 +3696,7 @@ static void test_CreateWindow(void) { HWND hwnd, parent; HMENU hmenu; + RECT rect; #define expect_menu(window, menu) \ SetLastError(0xdeadbeef); \ @@ -3715,6 +3716,75 @@ static void test_CreateWindow(void) SetLastError(0xdeadbeef); ok(IsMenu(hmenu), "IsMenu error %d\n", GetLastError()); + /* Test the window extents fixup */ + /* without WS_VISIBLE */ + SetLastError(0xdeadbeef); + hwnd = CreateWindowEx(0, "static", NULL, WS_POPUP, + 65537, 65537, 65539, 65539, parent, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); + GetWindowRect(hwnd, &rect); + ok(rect.right == 131076, "expected rect.right 131076 != %d\n", rect.right); + ok(rect.bottom == 131076, "expected rect.bottom 131076 != %d\n", rect.bottom); + ok(rect.left == 65537, "expected rect.right 65537 != %d\n", rect.right); + ok(rect.top == 65537, "expected rect.bottom 65537 != %d\n", rect.bottom); + DestroyWindow(hwnd); + + SetLastError(0xdeadbeef); + hwnd = CreateWindowEx(0, "static", NULL, WS_POPUP, + 0, 0, -10, -10, parent, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); + GetWindowRect(hwnd, &rect); + ok(rect.right == 0, "expected rect.right 0 != %d\n", rect.right); + ok(rect.bottom == 0, "expected rect.bottom 0 != %d\n", rect.bottom); + ok(rect.left == 0, "expected rect.left 0 != %d\n", rect.right); + ok(rect.top == 0, "expected rect.top 0 != %d\n", rect.bottom); + DestroyWindow(hwnd); + + SetLastError(0xdeadbeef); + hwnd = CreateWindowEx(0, "static", NULL, WS_POPUP, + 65537, 65537, -10, -10, parent, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); + GetWindowRect(hwnd, &rect); + ok(rect.right == 65537, "expected rect.right 65537 != %d\n", rect.right); + ok(rect.bottom == 65537, "expected rect.bottom 65537 != %d\n", rect.bottom); + ok(rect.left == 65537, "expected rect.left 65537 != %d\n", rect.right); + ok(rect.top == 65537, "expected rect.top 65537 != %d\n", rect.bottom); + DestroyWindow(hwnd); + + /* with WS_VISIBLE */ + SetLastError(0xdeadbeef); + hwnd = CreateWindowEx(0, "static", NULL, WS_POPUP | WS_VISIBLE, + 65537, 65537, 65539, 65539, parent, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); + GetWindowRect(hwnd, &rect); + ok(rect.right == 131076, "expected rect.right 131076 != %d\n", rect.right); + ok(rect.bottom == 131076, "expected rect.bottom 131076 != %d\n", rect.bottom); + ok(rect.left == 65537, "expected rect.left 65537 != %d\n", rect.right); + ok(rect.top == 65537, "expected rect.top 65537 != %d\n", rect.bottom); + DestroyWindow(hwnd); + + SetLastError(0xdeadbeef); + hwnd = CreateWindowEx(0, "static", NULL, WS_POPUP | WS_VISIBLE, + 0, 0, -10, -10, parent, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); + GetWindowRect(hwnd, &rect); + ok(rect.right == 0, "expected rect.right 0 != %d\n", rect.right); + ok(rect.bottom == 0, "expected rect.bottom 0 != %d\n", rect.bottom); + ok(rect.left == 0, "expected rect.left 0 != %d\n", rect.right); + ok(rect.top == 0, "expected rect.top 0 != %d\n", rect.bottom); + DestroyWindow(hwnd); + + SetLastError(0xdeadbeef); + hwnd = CreateWindowEx(0, "static", NULL, WS_POPUP | WS_VISIBLE, + 65537, 65537, -10, -10, parent, 0, 0, NULL); + ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); + GetWindowRect(hwnd, &rect); + ok(rect.right == 65537, "expected rect.right 65537 != %d\n", rect.right); + ok(rect.bottom == 65537, "expected rect.bottom 65537 != %d\n", rect.bottom); + ok(rect.left == 65537, "expected rect.right 65537 != %d\n", rect.right); + ok(rect.top == 65537, "expected rect.bottom 65537 != %d\n", rect.bottom); + DestroyWindow(hwnd); + /* WS_CHILD */ SetLastError(0xdeadbeef); hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD,