ReactOS 0.4.15-dev-7693-gd0e2924
rosdlgs.h
Go to the documentation of this file.
1#pragma once
2
3#include <atlwin.h>
4
5namespace ATL
6{
7 template <class T>
8 class CPropertyPageImpl: public CDialogImplBaseT<CWindow>
9 {
10 public:
12
13 operator PROPSHEETPAGE*()
14 {
15 return &m_psp;
16 }
17
19 {
20 T* pT = static_cast<T*>(this);
21
22 memset(&m_psp, 0, sizeof(m_psp));
23 m_psp.dwSize = sizeof(m_psp);
24 m_psp.hInstance = _AtlBaseModule.GetResourceInstance();
25 m_psp.pszTemplate = MAKEINTRESOURCE(T::IDD);
26 m_psp.pszTitle = lpszTitle;
27 m_psp.pfnDlgProc = T::StartDialogProc;
28 m_psp.pfnCallback = T::PropPageCallback;
29 m_psp.lParam = reinterpret_cast<LPARAM>(pT);
30
31 m_psp.dwFlags = PSP_USECALLBACK;
32 if (lpszTitle)
33 m_psp.dwFlags |= PSP_USETITLE;
34 }
35
37 {
38 T* pT = reinterpret_cast<T*>(ppsp->lParam);
40
41 switch (uMsg)
42 {
43 case PSPCB_CREATE:
44 _AtlWinModule.AddCreateWndData(&pThis->m_thunk.cd, pThis);
45 return pT->OnPageCreate();
46 case PSPCB_ADDREF:
47 pT->OnPageAddRef();
48 break;
49 case PSPCB_RELEASE:
50 pT->OnPageRelease();
51 break;
52 }
53
54 return 0;
55 }
56
58 {
59 return ::CreatePropertySheetPage(&m_psp);
60 }
61
62 BOOL EndDialog(_In_ int nRetCode)
63 {
64 return FALSE;
65 }
66
67 void SetModified(BOOL bChanged = TRUE)
68 {
70 }
71
73 {
75 }
76
78 {
79 return TRUE;
80 }
81
83 {
84 }
85
87 {
88 }
89
91 {
92 return 0;
93 }
94
96 {
97 return FALSE;
98 }
99
101 {
102 return PSNRET_NOERROR;
103 }
104
105 void OnReset()
106 {
107 }
108
109 void OnHelp()
110 {
111 }
112
114 {
115 return 0;
116 }
117
119 {
120 return 0;
121 }
122
124 {
125 return FALSE;
126 }
127
129 {
130 return FALSE;
131 }
132
134 {
135 return FALSE;
136 }
137
139 {
140 return 0;
141 }
142
144 {
145 return NULL;
146 }
147
148 // message map and handlers
153
155 {
156 NMHDR* pnmh = (NMHDR*)lParam;
157 T* pThis = static_cast<T*>(this);
158
159 if (pnmh->hwndFrom != GetParent() && pnmh->hwndFrom != m_hWnd)
160 {
161 bHandled = FALSE;
162 return TRUE;
163 }
164
165 switch (pnmh->code)
166 {
167 case PSN_SETACTIVE:
168 return pThis->OnSetActive();
169 case PSN_KILLACTIVE:
170 return pThis->OnKillActive();
171 case PSN_APPLY:
172 return pThis->OnApply();
173 case PSN_RESET:
174 pThis->OnReset();
175 return 0;
176 case PSN_HELP:
177 pThis->OnHelp();
178 return 0;
179 case PSN_WIZBACK:
180 return pThis->OnWizardBack();
181 case PSN_WIZNEXT:
182 return pThis->OnWizardNext();
183 case PSN_WIZFINISH:
184 return pThis->OnWizardFinish();
185 case PSN_QUERYCANCEL:
186 return pThis->OnQueryCancel();
187 case PSN_GETOBJECT:
188 return pThis->OnGetObject((LPNMOBJECTNOTIFY)lParam);
190 return pThis->OnTranslateAccelerator((LPMSG)lParam);
192 return (LRESULT)pThis->OnQueryInitialFocus((HWND)lParam);
193 }
194
195 bHandled = FALSE;
196 return 0;
197 }
198 };
199}
CPropertyPageImpl(LPCTSTR lpszTitle=NULL)
Definition: rosdlgs.h:18
BOOL OnGetObject(LPNMOBJECTNOTIFY lpObjectNotify)
Definition: rosdlgs.h:133
void SetModified(BOOL bChanged=TRUE)
Definition: rosdlgs.h:67
CPropertyPageImpl< T > thisClass
Definition: rosdlgs.h:149
HPROPSHEETPAGE Create()
Definition: rosdlgs.h:57
LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: rosdlgs.h:154
static UINT CALLBACK PropPageCallback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
Definition: rosdlgs.h:36
HWND OnQueryInitialFocus(HWND hwnd)
Definition: rosdlgs.h:143
void SetWizardButtons(DWORD dwFlags)
Definition: rosdlgs.h:72
BOOL EndDialog(_In_ int nRetCode)
Definition: rosdlgs.h:62
int OnTranslateAccelerator(LPMSG lpMsg)
Definition: rosdlgs.h:138
PROPSHEETPAGE m_psp
Definition: rosdlgs.h:11
CWndProcThunk m_thunk
Definition: atlwin.h:1379
CWindow GetParent() const
Definition: atlwin.h:700
HWND m_hWnd
Definition: atlwin.h:273
_AtlCreateWndData cd
Definition: atlwin.h:236
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1926
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define END_MSG_MAP()
Definition: atlwin.h:1917
#define T
Definition: mbstring.h:31
#define PSN_QUERYINITIALFOCUS
Definition: settings.cpp:98
#define _In_
Definition: ms_sal.h:308
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
Definition: rosdlgs.h:6
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define PSPCB_CREATE
Definition: prsht.h:38
#define PSM_CHANGED
Definition: prsht.h:164
#define PSPCB_ADDREF
Definition: prsht.h:171
#define PSN_GETOBJECT
Definition: prsht.h:124
#define PSM_SETWIZBUTTONS
Definition: prsht.h:157
#define PSP_USETITLE
Definition: prsht.h:26
#define PSN_QUERYCANCEL
Definition: prsht.h:123
#define PSM_UNCHANGED
Definition: prsht.h:159
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define PSN_APPLY
Definition: prsht.h:117
#define PSPCB_RELEASE
Definition: prsht.h:37
#define PSN_TRANSLATEACCELERATOR
Definition: prsht.h:125
#define PSNRET_NOERROR
Definition: prsht.h:129
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZFINISH
Definition: prsht.h:122
#define PSP_USECALLBACK
Definition: prsht.h:30
#define PSN_HELP
Definition: prsht.h:119
#define PSN_RESET
Definition: prsht.h:118
#define PSN_WIZBACK
Definition: prsht.h:120
#define PSN_SETACTIVE
Definition: prsht.h:115
#define PROPSHEETPAGE
Definition: prsht.h:389
#define WM_NOTIFY
Definition: richedit.h:61
#define memset(x, y, z)
Definition: compat.h:39
UINT code
Definition: winuser.h:3158
HWND hwndFrom
Definition: winuser.h:3156
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define SendMessage
Definition: winuser.h:5842
#define PostMessage
Definition: winuser.h:5831
#define MAKEINTRESOURCE
Definition: winuser.h:591
const CHAR * LPCTSTR
Definition: xmlstorage.h:193