ReactOS  0.4.15-dev-3175-g222acf5
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;
24  DWORD style;
25  BOOL ret;
26 
28  CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
static const CHAR s_name[]
Definition: ShowWindow.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GetWindowLongPtrA
Definition: winuser.h:4804
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define GWL_STYLE
Definition: winuser.h:846
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
Arabic default style
Definition: afstyles.h:93

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));
173  wc.lpfnWndProc = WindowProc;
175  wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
176  wc.lpszClassName = s_name;
177  ok_int(1, !!RegisterClassA(&wc));
178 
179  for (iTest = 0; iTest < _countof(s_entries); ++iTest)
180  {
182  }
183 }
static const TEST_ENTRY s_entries[]
Definition: ShowWindow.c:63
#define ZeroMemory
Definition: winbase.h:1664
HBRUSH hbrBackground
Definition: winuser.h:3146
static const CHAR s_name[]
Definition: ShowWindow.c:19
#define COLOR_3DFACE
Definition: winuser.h:919
#define ok_int(expression, result)
Definition: atltest.h:134
static void DoTestEntry(const TEST_ENTRY *pEntry)
Definition: ShowWindow.c:21
int iTest
Definition: menu.cpp:212
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ShowWindow.c:152
#define _countof(array)
Definition: sndvol32.h:68
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
LPCSTR lpszClassName
Definition: winuser.h:3148
HINSTANCE hInstance
Definition: winuser.h:3143
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WNDPROC lpfnWndProc
Definition: winuser.h:3140
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)

◆ 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:
159  PostQuitMessage(0);
160  break;
161  default:
162  return DefWindowProcA(hwnd, uMsg, wParam, lParam);
163  }
164  return 0;
165 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT uMsg
Definition: menu.cpp:213
WPARAM wParam
Definition: combotst.c:138
#define WM_DESTROY
Definition: winuser.h:1592
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1591
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

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