ReactOS 0.4.15-dev-7674-gc0b4db1
GetClipRgn.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for GetClipRgn
5 * PROGRAMMERS: Timo Kreuzer
6 */
7
8#include "precomp.h"
9
11{
12 HWND hWnd;
13 HDC hDC;
14 HRGN hrgn;//, hrgn2;
15 int ret;
16
17 /* Create a window */
18 hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
20 NULL, NULL, 0, 0);
21
22 hDC = GetDC(hWnd);
23 hrgn = CreateRectRgn(0,0,0,0);
24
25 /* Test invalid DC */
27 ret = GetClipRgn((HDC)0x12345, hrgn);
28 ok(ret == -1, "Expected -1, got %d\n", ret);
29 ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
30
31 /* Test invalid hrgn */
33 ret = GetClipRgn(hDC, (HRGN)0x12345);
34 ok(ret == 0, "Expected 0, got %d\n", ret);
35 ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
36
39}
40
42{
44}
45
static HDC hDC
Definition: 3dtext.c:33
void Test_GetClipRgn()
Definition: GetClipRgn.c:10
static HRGN hrgn
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
HWND hWnd
Definition: settings.c:17
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
static HDC
Definition: imagelist.c:92
#define L(x)
Definition: ntvdm.h:50
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4315
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI DestroyWindow(_In_ HWND)