ReactOS  0.4.12-dev-18-gf469aca
ATL::CDialogImplBaseT< TBase > Class Template Reference

#include <atlwin.h>

Inheritance diagram for ATL::CDialogImplBaseT< TBase >:
Collaboration diagram for ATL::CDialogImplBaseT< TBase >:

Public Member Functions

virtual ~CDialogImplBaseT ()
 
virtual DLGPROC GetDialogProc ()
 
virtual void OnFinalMessage (HWND)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< TBase >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CMessageMap
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)=0
 

Static Public Member Functions

static INT_PTR CALLBACK StartDialogProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK DialogProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 

Detailed Description

template<class TBase = CWindow>
class ATL::CDialogImplBaseT< TBase >

Definition at line 1319 of file atlwin.h.

Constructor & Destructor Documentation

◆ ~CDialogImplBaseT()

template<class TBase = CWindow>
virtual ATL::CDialogImplBaseT< TBase >::~CDialogImplBaseT ( )
inlinevirtual

Definition at line 1326 of file atlwin.h.

1327  {
1328  }

Member Function Documentation

◆ DialogProc()

template<class TBase = CWindow>
static INT_PTR CALLBACK ATL::CDialogImplBaseT< TBase >::DialogProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlinestatic

Definition at line 1352 of file atlwin.h.

1353  {
1354  CDialogImplBaseT<TBase> *pThis = reinterpret_cast<CDialogImplBaseT<TBase>*>(hWnd);
1355  _ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
1356  LRESULT lResult = 0;
1357  const _ATL_MSG *previousMessage;
1358  BOOL handled;
1359 
1360  hWnd = pThis->m_hWnd;
1361  previousMessage = pThis->m_pCurrentMsg;
1362  pThis->m_pCurrentMsg = &msg;
1363 
1364  handled = pThis->ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, 0);
1365  ATLASSERT(pThis->m_pCurrentMsg == &msg);
1366 
1367  if (handled)
1368  {
1369  if ((pThis->m_dwState & WINSTATE_DESTROYED) == 0)
1370  {
1371  ::SetWindowLongPtr(pThis->m_hWnd, DWLP_MSGRESULT, lResult);
1372  }
1373  }
1374  else
1375  {
1376  if (uMsg == WM_NCDESTROY)
1377  {
1378  pThis->m_dwState |= WINSTATE_DESTROYED;
1379  }
1380  }
1381 
1382  ATLASSERT(pThis->m_pCurrentMsg == &msg);
1383  pThis->m_pCurrentMsg = previousMessage;
1384 
1385  if (previousMessage == NULL && (pThis->m_dwState & WINSTATE_DESTROYED) != 0)
1386  {
1387  pThis->m_dwState &= ~WINSTATE_DESTROYED;
1388  pThis->m_hWnd = NULL;
1389  pThis->OnFinalMessage(hWnd);
1390  }
1391  return lResult;
1392  }
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
HWND hWnd
Definition: settings.c:17
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
UINT msg
Definition: msvc.h:92
smooth NULL
Definition: ftsmooth.c:416
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_NCDESTROY
Definition: winuser.h:1666
#define msg(x)
Definition: auth_time.c:54
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

◆ GetDialogProc()

template<class TBase = CWindow>
virtual DLGPROC ATL::CDialogImplBaseT< TBase >::GetDialogProc ( )
inlinevirtual

Definition at line 1329 of file atlwin.h.

Referenced by ATL::CDialogImplBaseT< CWindow >::StartDialogProc().

1330  {
1331  return DialogProc;
1332  }
static INT_PTR CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1352

◆ OnFinalMessage()

template<class TBase = CWindow>
virtual void ATL::CDialogImplBaseT< TBase >::OnFinalMessage ( HWND  )
inlinevirtual

Definition at line 1394 of file atlwin.h.

Referenced by ATL::CDialogImplBaseT< CWindow >::DialogProc().

1395  {
1396  }

◆ StartDialogProc()

template<class TBase = CWindow>
static INT_PTR CALLBACK ATL::CDialogImplBaseT< TBase >::StartDialogProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlinestatic

Definition at line 1334 of file atlwin.h.

1335  {
1336  CDialogImplBaseT<TBase> *pThis;
1337  DLGPROC newDlgProc;
1338  DLGPROC GCCU(pOldProc);
1339 
1340  pThis = reinterpret_cast<CDialogImplBaseT<TBase>*>(_AtlWinModule.ExtractCreateWndData());
1341  ATLASSERT(pThis != NULL);
1342  if (pThis == NULL)
1343  return 0;
1344  pThis->m_thunk.Init((WNDPROC)pThis->GetDialogProc(), pThis);
1345  newDlgProc = reinterpret_cast<DLGPROC>(pThis->m_thunk.GetWNDPROC());
1346  pOldProc = reinterpret_cast<DLGPROC>(::SetWindowLongPtr(hWnd, DWLP_DLGPROC, reinterpret_cast<LONG_PTR>(newDlgProc)));
1347  Unused(pOldProc); // TODO: should generate trace message if overwriting another subclass
1348  pThis->m_hWnd = hWnd;
1349  return newDlgProc(hWnd, uMsg, wParam, lParam);
1350  }
#define DWLP_DLGPROC
Definition: winuser.h:865
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
HWND hWnd
Definition: settings.c:17
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
CAtlWinModule _AtlWinModule
Definition: atlbase.cpp:27
void * ExtractCreateWndData()
Definition: atlbase.h:991
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2849
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
#define GCCU(x)
Definition: atlwin.h:27
LPARAM lParam
Definition: combotst.c:139
#define Unused(x)
Definition: atlwin.h:28

The documentation for this class was generated from the following file: