reactos/rostests/apitests/user32/ScrollWindowEx.c
Timo Kreuzer 57434c8ebf Add missing files
svn path=/trunk/; revision=48620
2010-08-25 08:50:10 +00:00

64 lines
1.8 KiB
C

/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for ScrollWindowEx
* PROGRAMMERS: Timo Kreuzer
*/
#include <stdio.h>
#include <wine/test.h>
#include <windows.h>
void Test_ScrollWindowEx()
{
HWND hWnd;
HRGN hrgn;
int Result;
/* Create a window */
hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
NULL, NULL, 0, 0);
UpdateWindow(hWnd);
/* Assert that no update region is there */
hrgn = CreateRectRgn(0,0,0,0);
Result = GetUpdateRgn(hWnd, hrgn, FALSE);
ok(Result == NULLREGION, "Result = %d\n", Result);
Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, 0);
ok(Result == SIMPLEREGION, "Result = %d\n", Result);
Result = GetUpdateRgn(hWnd, hrgn, FALSE);
ok(Result == NULLREGION, "Result = %d\n", Result);
Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, SW_INVALIDATE);
ok(Result == SIMPLEREGION, "Result = %d\n", Result);
Result = GetUpdateRgn(hWnd, hrgn, FALSE);
ok(Result == SIMPLEREGION, "Result = %d\n", Result);
UpdateWindow(hWnd);
// test invalid update region
DeleteObject(hrgn);
Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, hrgn, NULL, SW_INVALIDATE);
ok(Result == ERROR, "Result = %d\n", Result);
hrgn = CreateRectRgn(0,0,0,0);
UpdateWindow(hWnd);
// Test invalid updaterect pointer
Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, (LPRECT)1, SW_INVALIDATE);
ok(Result == ERROR, "Result = %d\n", Result);
Result = GetUpdateRgn(hWnd, hrgn, FALSE);
ok(Result == SIMPLEREGION, "Result = %d\n", Result);
// test for alignment of rects
DeleteObject(hrgn);
DestroyWindow(hWnd);
}
START_TEST(ScrollWindowEx)
{
Test_ScrollWindowEx();
}