ReactOS 0.4.15-dev-7711-g5627da4
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 {
39 }
40 break;
41 }
42}
#define edt1
Definition: dlgs.h:65
#define TRUE
Definition: types.h:120
static BOOL s_bNotified
Definition: propsheet.c:16
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define IDCANCEL
Definition: winuser.h:830
#define IDOK
Definition: winuser.h:829
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define EN_CHANGE
Definition: winuser.h:2021

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}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define L(x)
Definition: ntvdm.h:50
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)

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}
#define ok_int(expression, result)
Definition: atltest.h:134
#define IDC_APPLY_BUTTON
Definition: comctl32.h:54
static HWND hwndParent
Definition: cryptui.c:300
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define PropSheet_UnChanged(d, w)
Definition: prsht.h:358
#define PSBTN_OK
Definition: prsht.h:149
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI IsWindowEnabled(_In_ HWND)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

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}
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 HANDLE_MSG(hwnd, message, fn)
Definition: windowsx.h:322
#define WM_COMMAND
Definition: winuser.h:1739
#define WM_INITDIALOG
Definition: winuser.h:1738
#define WM_TIMER
Definition: winuser.h:1741

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}
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define LoadLibraryW(x)
Definition: compat.h:747
HPROPSHEETPAGE(WINAPI * FN_CreatePropertySheetPageW)(LPCPROPSHEETPAGEW)
Definition: propsheet.c:119
static FN_PropertySheetW pPropertySheetW
Definition: propsheet.c:122
static FN_CreatePropertySheetPageW pCreatePropertySheetPageW
Definition: propsheet.c:121
static void test_ApplyButtonDisabled()
Definition: propsheet.c:125
static void test_StructSizes()
Definition: propsheet.c:86
int(WINAPI * FN_PropertySheetW)(LPCPROPSHEETHEADERW)
Definition: propsheet.c:120

◆ test_ApplyButtonDisabled()

static void test_ApplyButtonDisabled ( )
static

Definition at line 125 of file propsheet.c.

126{
127 PROPSHEETPAGEW psp = {0};
129 HPROPSHEETPAGE hpsp[1];
130
131 psp.dwSize = sizeof(psp);
132 psp.dwFlags = PSP_DEFAULT;
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}
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
static INT_PTR CALLBACK Page1DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.c:66
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define PSP_DEFAULT
Definition: prsht.h:22
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPCWSTR pszTemplate
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:216
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

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 CHECK_STRUCT_SIZE(x, y)
Definition: propsheet.c:82
#define PROPSHEETPAGEA_V2_SIZE
Definition: prsht.h:210
#define PROPSHEETHEADERA_V1_SIZE
Definition: prsht.h:290
#define PROPSHEETPAGEA_V1_SIZE
Definition: prsht.h:209
#define PROPSHEETPAGEW_V2_SIZE
Definition: prsht.h:247
#define PROPSHEETPAGEA_V4_SIZE
Definition: prsht.h:212
#define PROPSHEETPAGEA_V3_SIZE
Definition: prsht.h:211
#define PROPSHEETHEADERW_V2_SIZE
Definition: prsht.h:326
#define PROPSHEETPAGEW_V3_SIZE
Definition: prsht.h:248
#define PROPSHEETPAGEW_V4_SIZE
Definition: prsht.h:249
#define PROPSHEETHEADERA_V2_SIZE
Definition: prsht.h:291
#define PROPSHEETPAGEW_V1_SIZE
Definition: prsht.h:246
#define PROPSHEETHEADERW_V1_SIZE
Definition: prsht.h:325

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().