[FASTFAT]
[reactos.git] / rostests / apitests / user32api / tests / ScrollWindowEx.c
1 #include "../user32api.h"
2
3 INT
4 Test_ScrollWindowEx(PTESTINFO pti)
5 {
6 HWND hWnd;
7 HRGN hrgn;
8 int Result;
9
10 /* Create a window */
11 hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
12 CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
13 NULL, NULL, g_hInstance, 0);
14 UpdateWindow(hWnd);
15
16 /* Assert that no update region is there */
17 hrgn = CreateRectRgn(0,0,0,0);
18 ASSERT(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
19
20 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, 0);
21 TEST(Result == SIMPLEREGION);
22 TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
23
24 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, SW_INVALIDATE);
25 TEST(Result == SIMPLEREGION);
26 TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == SIMPLEREGION);
27 UpdateWindow(hWnd);
28
29 // test invalid update region
30 DeleteObject(hrgn);
31 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, hrgn, NULL, SW_INVALIDATE);
32 TEST(Result == ERROR);
33 hrgn = CreateRectRgn(0,0,0,0);
34 UpdateWindow(hWnd);
35
36 // Test invalid updaterect pointer
37 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, (LPRECT)1, SW_INVALIDATE);
38 TEST(Result == ERROR);
39 TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == SIMPLEREGION);
40
41 // test for alignment of rects
42
43 DeleteObject(hrgn);
44 DestroyWindow(hWnd);
45
46 return APISTATUS_NORMAL;
47 }