Add missing files
[reactos.git] / rostests / apitests / user32 / ScrollWindowEx.c
1 /*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for ScrollWindowEx
5 * PROGRAMMERS: Timo Kreuzer
6 */
7
8 #include <stdio.h>
9 #include <wine/test.h>
10 #include <windows.h>
11
12 void Test_ScrollWindowEx()
13 {
14 HWND hWnd;
15 HRGN hrgn;
16 int Result;
17
18 /* Create a window */
19 hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
20 CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
21 NULL, NULL, 0, 0);
22 UpdateWindow(hWnd);
23
24 /* Assert that no update region is there */
25 hrgn = CreateRectRgn(0,0,0,0);
26 Result = GetUpdateRgn(hWnd, hrgn, FALSE);
27 ok(Result == NULLREGION, "Result = %d\n", Result);
28
29 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, 0);
30 ok(Result == SIMPLEREGION, "Result = %d\n", Result);
31 Result = GetUpdateRgn(hWnd, hrgn, FALSE);
32 ok(Result == NULLREGION, "Result = %d\n", Result);
33
34 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, SW_INVALIDATE);
35 ok(Result == SIMPLEREGION, "Result = %d\n", Result);
36 Result = GetUpdateRgn(hWnd, hrgn, FALSE);
37 ok(Result == SIMPLEREGION, "Result = %d\n", Result);
38 UpdateWindow(hWnd);
39
40 // test invalid update region
41 DeleteObject(hrgn);
42 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, hrgn, NULL, SW_INVALIDATE);
43 ok(Result == ERROR, "Result = %d\n", Result);
44 hrgn = CreateRectRgn(0,0,0,0);
45 UpdateWindow(hWnd);
46
47 // Test invalid updaterect pointer
48 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, (LPRECT)1, SW_INVALIDATE);
49 ok(Result == ERROR, "Result = %d\n", Result);
50 Result = GetUpdateRgn(hWnd, hrgn, FALSE);
51 ok(Result == SIMPLEREGION, "Result = %d\n", Result);
52
53 // test for alignment of rects
54
55 DeleteObject(hrgn);
56 DestroyWindow(hWnd);
57 }
58
59 START_TEST(ScrollWindowEx)
60 {
61 Test_ScrollWindowEx();
62 }
63