ReactOS  0.4.15-dev-321-g2d9b385
propsheet.c File Reference
#include "wine/test.h"
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <prsht.h>
Include dependency graph for propsheet.c:

Go to the source code of this file.

Macros

#define IDC_APPLY_BUTTON   12321
 
#define CHECK_STRUCT_SIZE(x, y)   ok((x) == (y), "Wrong size for %s, got %u, expected %u\n", #x, y, x)
 

Typedefs

typedef HPROPSHEETPAGE(WINAPIFN_CreatePropertySheetPageW) (LPCPROPSHEETPAGEW)
 
typedef int(WINAPIFN_PropertySheetW) (LPCPROPSHEETHEADERW)
 

Functions

static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
 
static void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
static void OnTimer (HWND hwnd, UINT id)
 
static INT_PTR CALLBACK Page1DlgProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static void test_StructSizes ()
 
static void test_ApplyButtonDisabled ()
 
 START_TEST (propsheet)
 

Variables

static BOOL s_bNotified
 
static FN_CreatePropertySheetPageW pCreatePropertySheetPageW
 
static FN_PropertySheetW pPropertySheetW
 

Macro Definition Documentation

◆ CHECK_STRUCT_SIZE

#define CHECK_STRUCT_SIZE (   x,
  y 
)    ok((x) == (y), "Wrong size for %s, got %u, expected %u\n", #x, y, x)

Definition at line 82 of file propsheet.c.

◆ IDC_APPLY_BUTTON

#define IDC_APPLY_BUTTON   12321

Definition at line 14 of file propsheet.c.

Typedef Documentation

◆ FN_CreatePropertySheetPageW

typedef HPROPSHEETPAGE(WINAPI * FN_CreatePropertySheetPageW) (LPCPROPSHEETPAGEW)

Definition at line 119 of file propsheet.c.

◆ FN_PropertySheetW

typedef int(WINAPI * FN_PropertySheetW) (LPCPROPSHEETHEADERW)

Definition at line 120 of file propsheet.c.

Function Documentation

◆ OnCommand()

static void OnCommand ( HWND  hwnd,
int  id,
HWND  hwndCtl,
UINT  codeNotify 
)
static

Definition at line 26 of file propsheet.c.

27 {
28  switch (id)
29  {
30  case IDOK:
31  case IDCANCEL:
32  EndDialog(hwnd, id);
33  break;
34  case edt1:
35  if (codeNotify == EN_CHANGE)
36  {
37  s_bNotified = TRUE;
39  }
40  break;
41  }
42 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
static BOOL s_bNotified
Definition: propsheet.c:16
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define edt1
Definition: dlgs.h:65
HWND WINAPI GetParent(_In_ HWND)
#define IDCANCEL
Definition: winuser.h:825
#define EN_CHANGE
Definition: winuser.h:2004

Referenced by Page1DlgProc().

◆ OnInitDialog()

static BOOL OnInitDialog ( HWND  hwnd,
HWND  hwndFocus,
LPARAM  lParam 
)
static

Definition at line 18 of file propsheet.c.

19 {
21  SetDlgItemTextW(hwnd, edt1, L"text");
22  SetTimer(hwnd, 999, 300, NULL);
23  return TRUE;
24 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
static BOOL s_bNotified
Definition: propsheet.c:16
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
smooth NULL
Definition: ftsmooth.c:416
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define edt1
Definition: dlgs.h:65
static const WCHAR L[]
Definition: oid.c:1250

Referenced by Page1DlgProc().

◆ OnTimer()

static void OnTimer ( HWND  hwnd,
UINT  id 
)
static

Definition at line 44 of file propsheet.c.

45 {
46  HWND hwndParent, hwndApply;
47 
48  KillTimer(hwnd, id);
49 
51 
54  ok_int(IsWindowEnabled(hwndApply), FALSE);
55 
57  ok_int(IsWindowEnabled(hwndApply), TRUE);
58 
60  ok_int(IsWindowEnabled(hwndApply), FALSE);
61 
63 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define IDC_APPLY_BUTTON
Definition: propsheet.c:14
static BOOL s_bNotified
Definition: propsheet.c:16
static HWND hwndParent
Definition: cryptui.c:300
#define ok_int(expression, result)
Definition: atltest.h:134
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define PropSheet_UnChanged(d, w)
Definition: prsht.h:358
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSBTN_OK
Definition: prsht.h:149
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
HWND WINAPI GetParent(_In_ HWND)
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348

Referenced by Page1DlgProc().

◆ Page1DlgProc()

static INT_PTR CALLBACK Page1DlgProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 66 of file propsheet.c.

67 {
68  switch (uMsg)
69  {
73  }
74  return 0;
75 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
Definition: propsheet.c:18
static void OnTimer(HWND hwnd, UINT id)
Definition: propsheet.c:44
static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
Definition: propsheet.c:26
#define WM_TIMER
Definition: winuser.h:1724
#define WM_COMMAND
Definition: winuser.h:1722
#define HANDLE_MSG(hwnd, message, fn)
Definition: windowsx.h:297
#define WM_INITDIALOG
Definition: winuser.h:1721

Referenced by test_ApplyButtonDisabled().

◆ START_TEST()

START_TEST ( propsheet  )

Definition at line 150 of file propsheet.c.

151 {
152  HMODULE hComCtl32;
153 
154  hComCtl32 = LoadLibraryW(L"comctl32.dll");
155  pCreatePropertySheetPageW = (FN_CreatePropertySheetPageW)GetProcAddress(hComCtl32, "CreatePropertySheetPageW");
156  pPropertySheetW = (FN_PropertySheetW)GetProcAddress(hComCtl32, "PropertySheetW");
157 
158  ok(pCreatePropertySheetPageW != NULL, "pCreatePropertySheetPageW was NULL.\n");
159  ok(pPropertySheetW != NULL, "pPropertySheetW was NULL.\n");
160 
162  {
163  skip("!pCreatePropertySheetPageW || !pPropertySheetW\n");
164  return;
165  }
166 
169 
170  FreeLibrary(hComCtl32);
171 }
static void test_StructSizes()
Definition: propsheet.c:86
HPROPSHEETPAGE(WINAPI * FN_CreatePropertySheetPageW)(LPCPROPSHEETPAGEW)
Definition: propsheet.c:119
static FN_PropertySheetW pPropertySheetW
Definition: propsheet.c:122
int(WINAPI * FN_PropertySheetW)(LPCPROPSHEETHEADERW)
Definition: propsheet.c:120
#define LoadLibraryW(x)
Definition: compat.h:413
smooth NULL
Definition: ftsmooth.c:416
#define FreeLibrary(x)
Definition: compat.h:414
static FN_CreatePropertySheetPageW pCreatePropertySheetPageW
Definition: propsheet.c:121
static void test_ApplyButtonDisabled()
Definition: propsheet.c:125
static const WCHAR L[]
Definition: oid.c:1250
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define GetProcAddress(x, y)
Definition: compat.h:419

◆ test_ApplyButtonDisabled()

static void test_ApplyButtonDisabled ( )
static

Definition at line 125 of file propsheet.c.

126 {
127  PROPSHEETPAGEW psp = {0};
128  PROPSHEETHEADERW header = {0};
129  HPROPSHEETPAGE hpsp[1];
130 
131  psp.dwSize = sizeof(psp);
132  psp.dwFlags = PSP_DEFAULT;
134  psp.pszTemplate = MAKEINTRESOURCEW(1);
135  psp.pfnDlgProc = Page1DlgProc;
136  hpsp[0] = pCreatePropertySheetPageW(&psp);
137  ok(hpsp[0] != NULL, "hpsp[0] was NULL.\n");
138 
139  header.dwSize = sizeof(header);
140  header.dwFlags = 0;
141  header.hInstance = GetModuleHandleW(NULL);
142  header.hwndParent = NULL;
143  header.nPages = ARRAYSIZE(hpsp);
144  header.phpage = hpsp;
145  header.pszCaption = L"propsheet";
146  ok(pPropertySheetW(&header) > 0, "PropertySheet returned non-positive value.\n");
147 }
LPCWSTR pszTemplate
Definition: prsht.h:218
static FN_PropertySheetW pPropertySheetW
Definition: propsheet.c:122
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD dwSize
Definition: prsht.h:214
DLGPROC pfnDlgProc
Definition: prsht.h:226
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
#define PSP_DEFAULT
Definition: prsht.h:22
static FN_CreatePropertySheetPageW pCreatePropertySheetPageW
Definition: propsheet.c:121
static INT_PTR CALLBACK Page1DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.c:66
static const WCHAR L[]
Definition: oid.c:1250
HINSTANCE hInstance
Definition: prsht.h:216
#define ok(value,...)
Definition: atltest.h:57
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
DWORD dwFlags
Definition: prsht.h:215
struct CFHEADER header
Definition: fdi.c:101

Referenced by START_TEST().

◆ test_StructSizes()

static void test_StructSizes ( )
static

Definition at line 86 of file propsheet.c.

87 {
88 #ifdef _M_X64
95 
102 #else
109 
116 #endif
117 }
#define PROPSHEETHEADERW_V2_SIZE
Definition: prsht.h:326
#define PROPSHEETHEADERW_V1_SIZE
Definition: prsht.h:325
#define PROPSHEETPAGEW_V4_SIZE
Definition: prsht.h:249
#define PROPSHEETPAGEW_V2_SIZE
Definition: prsht.h:247
#define PROPSHEETHEADERA_V1_SIZE
Definition: prsht.h:290
#define PROPSHEETPAGEA_V1_SIZE
Definition: prsht.h:209
#define PROPSHEETPAGEA_V3_SIZE
Definition: prsht.h:211
#define PROPSHEETPAGEA_V2_SIZE
Definition: prsht.h:210
#define PROPSHEETPAGEW_V1_SIZE
Definition: prsht.h:246
#define PROPSHEETPAGEW_V3_SIZE
Definition: prsht.h:248
#define CHECK_STRUCT_SIZE(x, y)
Definition: propsheet.c:82
#define PROPSHEETHEADERA_V2_SIZE
Definition: prsht.h:291
#define PROPSHEETPAGEA_V4_SIZE
Definition: prsht.h:212

Referenced by START_TEST().

Variable Documentation

◆ pCreatePropertySheetPageW

◆ pPropertySheetW

FN_PropertySheetW pPropertySheetW
static

◆ s_bNotified

BOOL s_bNotified
static

Definition at line 16 of file propsheet.c.

Referenced by OnCommand(), OnInitDialog(), and OnTimer().