ReactOS 0.4.16-dev-329-g9223134
ScrollWindowEx.c File Reference
#include "precomp.h"
Include dependency graph for ScrollWindowEx.c:

Go to the source code of this file.

Functions

void Test_ScrollWindowEx ()
 
 START_TEST (ScrollWindowEx)
 

Function Documentation

◆ START_TEST()

START_TEST ( ScrollWindowEx  )

Definition at line 114 of file ScrollWindowEx.c.

115{
117}
void Test_ScrollWindowEx()

◆ Test_ScrollWindowEx()

void Test_ScrollWindowEx ( )

Definition at line 12 of file ScrollWindowEx.c.

13{
14 HWND hWnd, hChild1, hChild2;
15 HRGN hrgn;
16 int Result;
17 RECT rc, rcChild1, rcChild2;
18 INT x1, y1, x2, y2, dx, dy;
20
21 /* Create a window */
23 hWnd = CreateWindowW(L"STATIC", L"TestWindow", style, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100, NULL, NULL, 0, 0);
24 ok(hWnd != NULL, "hWnd was NULL.\n");
26
27 /* Assert that no update region is there */
28 hrgn = CreateRectRgn(0, 0, 0, 0);
30 ok(Result == NULLREGION, "Result = %d\n", Result);
31
32 Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, 0);
33 ok(Result == SIMPLEREGION, "Result = %d\n", Result);
35 ok(Result == NULLREGION, "Result = %d\n", Result);
36
38 ok(Result == SIMPLEREGION, "Result = %d\n", Result);
40 ok(Result == SIMPLEREGION, "Result = %d\n", Result);
42
43 // test invalid update region
46 ok(Result == ERROR, "Result = %d\n", Result);
47 hrgn = CreateRectRgn(0, 0, 0, 0);
49
50 // Test invalid updaterect pointer
52 ok(Result == ERROR, "Result = %d\n", Result);
54 ok(Result == SIMPLEREGION, "Result = %d\n", Result);
55
56 /* create child window 1 */
57 x1 = 1;
58 y1 = 3;
60 hChild1 = CreateWindowW(L"STATIC", L"Child1", style, x1, y1, 10, 10, hWnd, NULL, 0, 0);
61 ok(hChild1 != NULL, "hChild1 was NULL.\n");
62 UpdateWindow(hChild1);
63
64 /* create child window 2 */
65 x2 = 5;
66 y2 = 7;
68 hChild2 = CreateWindowW(L"STATIC", L"Child2", style, x2, y2, 10, 10, hWnd, NULL, 0, 0);
69 ok(hChild2 != NULL, "hChild2 was NULL.\n");
70 UpdateWindow(hChild2);
71
72 /* scroll with child windows */
73 dx = 3;
74 dy = 8;
77
78 /* check the positions */
79 GetWindowRect(hWnd, &rc);
80 GetWindowRect(hChild1, &rcChild1);
81 GetWindowRect(hChild2, &rcChild2);
82 ok_long(rcChild1.left - rc.left, x1 + dx);
83 ok_long(rcChild2.left - rc.left, x2 + dx);
84 ok_long(rcChild1.top - rc.top, y1 + dy);
85 ok_long(rcChild2.top - rc.top, y2 + dy);
86
87 /* update */
88 x1 += dx;
89 y1 += dy;
90 x2 += dx;
91 y2 += dy;
92
93 /* scroll with child windows */
94 dx = 9;
95 dy = -2;
98
99 /* check the positions */
100 GetWindowRect(hWnd, &rc);
101 GetWindowRect(hChild1, &rcChild1);
102 GetWindowRect(hChild2, &rcChild2);
103 ok_long(rcChild1.left - rc.left, x1 + dx);
104 ok_long(rcChild2.left - rc.left, x2 + dx);
105 ok_long(rcChild1.top - rc.top, y1 + dy);
106 ok_long(rcChild2.top - rc.top, y2 + dy);
107
108 DestroyWindow(hChild1);
109 DestroyWindow(hChild2);
112}
static HRGN hrgn
Arabic default style
Definition: afstyles.h:94
#define ok_long(expression, result)
Definition: atltest.h:133
#define ok(value,...)
Definition: atltest.h:57
HWND hWnd
Definition: settings.c:17
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define ERROR(name)
Definition: error_private.h:53
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
#define L(x)
Definition: ntvdm.h:50
#define SS_WHITERECT
Definition: pedump.c:698
#define WS_CHILD
Definition: pedump.c:617
#define SS_BLACKRECT
Definition: pedump.c:696
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT
Definition: typedefs.h:58
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define NULLREGION
Definition: wingdi.h:361
#define SIMPLEREGION
Definition: wingdi.h:362
#define SW_SCROLLCHILDREN
Definition: winuser.h:2581
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define SW_INVALIDATE
Definition: winuser.h:2582
int WINAPI GetUpdateRgn(_In_ HWND, _In_ HRGN, _In_ BOOL)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by START_TEST().