ReactOS  0.4.14-dev-583-g2a1ba2c
rosdlgs.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <atlwin.h>
4 
5 namespace 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);
39  CDialogImplBaseT<CWindow>* pThis = static_cast<CDialogImplBaseT<CWindow>*>(pT);
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  {
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 
100  int OnApply()
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
152  END_MSG_MAP()
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 }
HPROPSHEETPAGE Create()
Definition: rosdlgs.h:57
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
HWND OnQueryInitialFocus(HWND hwnd)
Definition: rosdlgs.h:143
CPropertyPageImpl(LPCTSTR lpszTitle=NULL)
Definition: rosdlgs.h:18
#define PSN_HELP
Definition: prsht.h:119
static UINT CALLBACK PropPageCallback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
Definition: rosdlgs.h:36
#define CALLBACK
Definition: compat.h:27
PROPSHEETPAGE m_psp
Definition: rosdlgs.h:11
#define PSP_USECALLBACK
Definition: prsht.h:30
UINT_PTR WPARAM
Definition: windef.h:207
#define PSN_APPLY
Definition: prsht.h:117
#define PSN_SETACTIVE
Definition: prsht.h:115
_AtlCreateWndData cd
Definition: atlwin.h:231
#define T
Definition: mbstring.h:31
WPARAM wParam
Definition: combotst.c:138
#define PSN_QUERYCANCEL
Definition: prsht.h:123
UINT code
Definition: winuser.h:3134
CPropertyPageImpl< T > thisClass
Definition: rosdlgs.h:149
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define PSN_WIZFINISH
Definition: prsht.h:122
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define PSM_SETWIZBUTTONS
Definition: prsht.h:157
BOOL OnGetObject(LPNMOBJECTNOTIFY lpObjectNotify)
Definition: rosdlgs.h:133
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PSPCB_RELEASE
Definition: prsht.h:37
#define CreatePropertySheetPage
Definition: prsht.h:381
Definition: rosdlgs.h:5
int OnTranslateAccelerator(LPMSG lpMsg)
Definition: rosdlgs.h:138
#define END_MSG_MAP()
Definition: atlwin.h:1789
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PSN_TRANSLATEACCELERATOR
Definition: prsht.h:125
#define PSNRET_NOERROR
Definition: prsht.h:129
BOOL EndDialog(_In_ int nRetCode)
Definition: rosdlgs.h:62
#define PSPCB_CREATE
Definition: prsht.h:38
static const WCHAR L[]
Definition: oid.c:1250
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HWND m_hWnd
Definition: atlwin.h:268
#define PSM_UNCHANGED
Definition: prsht.h:159
HWND hwndFrom
Definition: winuser.h:3132
#define PSP_USETITLE
Definition: prsht.h:26
#define _In_
Definition: no_sal2.h:204
CWndProcThunk m_thunk
Definition: atlwin.h:1311
#define PSN_GETOBJECT
Definition: prsht.h:124
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:976
#define PSN_RESET
Definition: prsht.h:118
unsigned int UINT
Definition: ndis.h:50
#define PSM_CHANGED
Definition: prsht.h:164
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1770
#define PSN_WIZBACK
Definition: prsht.h:120
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1798
#define PSPCB_ADDREF
Definition: prsht.h:171
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
CWindow GetParent() const
Definition: atlwin.h:654
LONG_PTR LRESULT
Definition: windef.h:209
void SetModified(BOOL bChanged=TRUE)
Definition: rosdlgs.h:67
#define memset(x, y, z)
Definition: compat.h:39
LPARAM lParam
Definition: combotst.c:139
#define PSN_QUERYINITIALFOCUS
Definition: settings.cpp:98
#define PROPSHEETPAGE
Definition: prsht.h:371
#define WM_NOTIFY
Definition: richedit.h:61
void SetWizardButtons(DWORD dwFlags)
Definition: rosdlgs.h:72
LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: rosdlgs.h:154