ReactOS 0.4.15-dev-5667-ged97270
ShowWindow.c File Reference
#include "precomp.h"
Include dependency graph for ShowWindow.c:

Go to the source code of this file.

Classes

struct  TEST_ENTRY
 

Macros

#define STYLE_0   WS_OVERLAPPEDWINDOW
 
#define STYLE_1   (WS_OVERLAPPEDWINDOW | WS_MAXIMIZE)
 
#define STYLE_2   (WS_OVERLAPPEDWINDOW | WS_MINIMIZE)
 
#define STYLE_3   (WS_OVERLAPPEDWINDOW | WS_VISIBLE)
 
#define STYLE_4   (WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_MAXIMIZE)
 
#define STYLE_5   (WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_MINIMIZE)
 
#define SW_0   -1
 
#define SW_1   SW_HIDE
 
#define SW_2   SW_MAXIMIZE
 
#define SW_3   SW_MINIMIZE
 
#define SW_4   SW_RESTORE
 
#define SW_5   SW_SHOW
 
#define SW_6   SW_SHOWDEFAULT
 
#define SW_7   SW_SHOWMAXIMIZED
 
#define SW_8   SW_SHOWMINIMIZED
 
#define SW_9   SW_SHOWMINNOACTIVE
 
#define SW_10   SW_SHOWNA
 
#define SW_11   SW_SHOWNOACTIVATE
 
#define SW_12   SW_SHOWNORMAL
 

Typedefs

typedef struct TEST_ENTRY TEST_ENTRY
 

Functions

static void DoTestEntry (const TEST_ENTRY *pEntry)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
 START_TEST (ShowWindow)
 

Variables

static const CHAR s_name [] = "ShowWindow test window"
 
static const TEST_ENTRY s_entries []
 

Macro Definition Documentation

◆ STYLE_0

#define STYLE_0   WS_OVERLAPPEDWINDOW

Definition at line 42 of file ShowWindow.c.

◆ STYLE_1

Definition at line 43 of file ShowWindow.c.

◆ STYLE_2

Definition at line 44 of file ShowWindow.c.

◆ STYLE_3

Definition at line 45 of file ShowWindow.c.

◆ STYLE_4

Definition at line 46 of file ShowWindow.c.

◆ STYLE_5

Definition at line 47 of file ShowWindow.c.

◆ SW_0

#define SW_0   -1

Definition at line 49 of file ShowWindow.c.

◆ SW_1

#define SW_1   SW_HIDE

Definition at line 50 of file ShowWindow.c.

◆ SW_10

#define SW_10   SW_SHOWNA

Definition at line 59 of file ShowWindow.c.

◆ SW_11

Definition at line 60 of file ShowWindow.c.

◆ SW_12

#define SW_12   SW_SHOWNORMAL

Definition at line 61 of file ShowWindow.c.

◆ SW_2

#define SW_2   SW_MAXIMIZE

Definition at line 51 of file ShowWindow.c.

◆ SW_3

#define SW_3   SW_MINIMIZE

Definition at line 52 of file ShowWindow.c.

◆ SW_4

#define SW_4   SW_RESTORE

Definition at line 53 of file ShowWindow.c.

◆ SW_5

#define SW_5   SW_SHOW

Definition at line 54 of file ShowWindow.c.

◆ SW_6

#define SW_6   SW_SHOWDEFAULT

Definition at line 55 of file ShowWindow.c.

◆ SW_7

Definition at line 56 of file ShowWindow.c.

◆ SW_8

Definition at line 57 of file ShowWindow.c.

◆ SW_9

Definition at line 58 of file ShowWindow.c.

Typedef Documentation

◆ TEST_ENTRY

Function Documentation

◆ DoTestEntry()

static void DoTestEntry ( const TEST_ENTRY pEntry)
static

Definition at line 21 of file ShowWindow.c.

22{
23 HWND hwnd;
25 BOOL ret;
26
30 ok(!!hwnd, "Line %d: CreateWindowA failed\n", pEntry->lineno);
31
32 ret = !!ShowWindow(hwnd, pEntry->nCmdShow);
33 ok(ret == pEntry->ret, "Line %d: ShowWindow returned %s\n", pEntry->lineno,
34 (ret ? "non-zero" : "zero"));
35
37 ok(style == pEntry->style1, "Line %d: style was 0x%lX\n", pEntry->lineno, style);
38
40}
static const CHAR s_name[]
Definition: ShowWindow.c:19
Arabic default style
Definition: afstyles.h:94
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
long LONG
Definition: pedump.c:60
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4305
#define GetWindowLongPtrA
Definition: winuser.h:4818
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( ShowWindow  )

Definition at line 167 of file ShowWindow.c.

168{
169 WNDCLASSA wc;
170 UINT iTest;
171
172 ZeroMemory(&wc, sizeof(wc));
175 wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
177 ok_int(1, !!RegisterClassA(&wc));
178
179 for (iTest = 0; iTest < _countof(s_entries); ++iTest)
180 {
181 DoTestEntry(&s_entries[iTest]);
182 }
183}
static void DoTestEntry(const TEST_ENTRY *pEntry)
Definition: ShowWindow.c:21
static const TEST_ENTRY s_entries[]
Definition: ShowWindow.c:63
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ShowWindow.c:152
#define ok_int(expression, result)
Definition: atltest.h:134
unsigned int UINT
Definition: ndis.h:50
#define _countof(array)
Definition: sndvol32.h:68
HBRUSH hbrBackground
Definition: winuser.h:3160
HINSTANCE hInstance
Definition: winuser.h:3157
LPCSTR lpszClassName
Definition: winuser.h:3162
WNDPROC lpfnWndProc
Definition: winuser.h:3154
#define ZeroMemory
Definition: winbase.h:1670
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define COLOR_3DFACE
Definition: winuser.h:923

◆ WindowProc()

static LRESULT CALLBACK WindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 152 of file ShowWindow.c.

153{
154 switch (uMsg)
155 {
156 case WM_CREATE:
157 return 0;
158 case WM_DESTROY:
160 break;
161 default:
162 return DefWindowProcA(hwnd, uMsg, wParam, lParam);
163 }
164 return 0;
165}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1598
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_DESTROY
Definition: winuser.h:1599

Referenced by START_TEST().

Variable Documentation

◆ s_entries

const TEST_ENTRY s_entries[]
static

Definition at line 63 of file ShowWindow.c.

Referenced by START_TEST().

◆ s_name

const CHAR s_name[] = "ShowWindow test window"
static