ReactOS 0.4.17-dev-1321-g5c122a9
ThemeRegion.c File Reference
#include <apitest.h>
#include <windows.h>
#include <uxtheme.h>
Include dependency graph for ThemeRegion.c:

Go to the source code of this file.

Functions

static int GetRgnType (HWND hWnd)
 
static void SetCaption (HWND hWnd, BOOL bCaption)
 
static void Resize (HWND hWnd, int size)
 
 START_TEST (ThemeRegion)
 

Function Documentation

◆ GetRgnType()

static int GetRgnType ( HWND  hWnd)
static

Definition at line 12 of file ThemeRegion.c.

13{
14 HRGN hrgn = CreateRectRgn(0, 0, 0, 0);
15 int ret = GetWindowRgn(hWnd, hrgn);
17 return ret;
18}
static HRGN hrgn
HWND hWnd
Definition: settings.c:17
return ret
Definition: mutex.c:147
pKey DeleteObject()
int WINAPI GetWindowRgn(_In_ HWND, _In_ HRGN)
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)

Referenced by START_TEST().

◆ Resize()

static void Resize ( HWND  hWnd,
int  size 
)
static

Definition at line 28 of file ThemeRegion.c.

29{
31}
#define NULL
Definition: types.h:112
GLsizeiptr size
Definition: glext.h:5919
#define SWP_NOACTIVATE
Definition: winuser.h:1253
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SWP_NOZORDER
Definition: winuser.h:1258

Referenced by DECLARE_INTERFACE_(), and START_TEST().

◆ SetCaption()

static void SetCaption ( HWND  hWnd,
BOOL  bCaption 
)
static

Definition at line 20 of file ThemeRegion.c.

21{
23 style = bCaption ? (style | WS_CAPTION) : (style & ~WS_CAPTION);
26}
#define WS_CAPTION
Definition: pedump.c:624
long LONG
Definition: pedump.c:60
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SWP_NOSIZE
Definition: winuser.h:1256
#define GWL_STYLE
Definition: winuser.h:863
Definition: style.c:91

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( ThemeRegion  )

Definition at line 33 of file ThemeRegion.c.

34{
35 HWND hWnd;
36
37 if (!IsThemeActive())
38 {
39 skip("No active theme, skipping ThemeRegion tests\n");
40 return;
41 }
42
44 100, 100, 200, 200, NULL, NULL, NULL, NULL);
45 ok(hWnd != NULL, "CreateWindowExW failed\n");
46 if (!hWnd)
47 return;
48
49 Resize(hWnd, 250);
50 if (GetRgnType(hWnd) == ERROR)
51 {
52 skip("No theme region (DWM?), skipping ThemeRegion tests\n");
54 return;
55 }
56
57 /* Removing the caption drops the theme region */
60
61 /* Restoring it brings the region back without a size change */
63 ok(GetRgnType(hWnd) != ERROR, "Expected a theme region\n");
64
65 /* And on the next resize */
66 Resize(hWnd, 260);
67 ok(GetRgnType(hWnd) != ERROR, "Expected a theme region\n");
68
69 /* An app defined region is kept */
70 SetWindowRgn(hWnd, CreateRectRgn(0, 0, 50, 50), TRUE);
73
75}
static void SetCaption(HWND hWnd, BOOL bCaption)
Definition: ThemeRegion.c:20
static int GetRgnType(HWND hWnd)
Definition: ThemeRegion.c:12
static void Resize(HWND hWnd, int size)
Definition: ThemeRegion.c:28
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define ok_int(expression, result)
Definition: atltest.h:134
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI IsThemeActive(void)
Definition: system.c:630
#define L(x)
Definition: resources.c:13
#define ERROR(name)
Definition: error_private.h:53
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
int WINAPI SetWindowRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define SIMPLEREGION
Definition: wingdi.h:362