ReactOS  0.4.12-dev-57-g7050ac4
ATL::CContainedWindowT< TBase, TWinTraits > Class Template Reference

#include <atlwin.h>

Inheritance diagram for ATL::CContainedWindowT< TBase, TWinTraits >:
Collaboration diagram for ATL::CContainedWindowT< TBase, TWinTraits >:

Public Member Functions

 CContainedWindowT (CMessageMap *pObject, DWORD dwMsgMapID=0)
 
 CContainedWindowT (LPTSTR lpszClassName, CMessageMap *pObject, DWORD dwMsgMapID=0)
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL SubclassWindow (HWND hWnd)
 

Static Public Member Functions

static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Public Attributes

CWndProcThunk m_thunk
 
LPCTSTR m_lpszClassName
 
WNDPROC m_pfnSuperWindowProc
 
CMessageMapm_pObject
 
DWORD m_dwMsgMapID
 
const _ATL_MSGm_pCurrentMsg
 

Detailed Description

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
class ATL::CContainedWindowT< TBase, TWinTraits >

Definition at line 1646 of file atlwin.h.

Constructor & Destructor Documentation

◆ CContainedWindowT() [1/2]

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
ATL::CContainedWindowT< TBase, TWinTraits >::CContainedWindowT ( CMessageMap pObject,
DWORD  dwMsgMapID = 0 
)
inline

Definition at line 1656 of file atlwin.h.

1657  {
1658  m_lpszClassName = TBase::GetWndClassName();
1660  m_pObject = pObject;
1661  m_dwMsgMapID = dwMsgMapID;
1662  m_pCurrentMsg = NULL;
1663  }
const _ATL_MSG * m_pCurrentMsg
Definition: atlwin.h:1654
smooth NULL
Definition: ftsmooth.c:416
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1674
CMessageMap * m_pObject
Definition: atlwin.h:1652
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1651
LPCTSTR m_lpszClassName
Definition: atlwin.h:1650

◆ CContainedWindowT() [2/2]

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
ATL::CContainedWindowT< TBase, TWinTraits >::CContainedWindowT ( LPTSTR  lpszClassName,
CMessageMap pObject,
DWORD  dwMsgMapID = 0 
)
inline

Definition at line 1665 of file atlwin.h.

1666  {
1667  m_lpszClassName = lpszClassName;
1669  m_pObject = pObject;
1670  m_dwMsgMapID = dwMsgMapID;
1671  m_pCurrentMsg = NULL;
1672  }
const _ATL_MSG * m_pCurrentMsg
Definition: atlwin.h:1654
smooth NULL
Definition: ftsmooth.c:416
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1674
CMessageMap * m_pObject
Definition: atlwin.h:1652
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1651
LPCTSTR m_lpszClassName
Definition: atlwin.h:1650

Member Function Documentation

◆ DefWindowProc()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
LRESULT ATL::CContainedWindowT< TBase, TWinTraits >::DefWindowProc ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inline

Definition at line 1674 of file atlwin.h.

Referenced by ATL::CContainedWindowT< TBase, TWinTraits >::WindowProc().

1675  {
1677  }
#define CallWindowProc
Definition: winuser.h:5601
WPARAM wParam
Definition: combotst.c:138
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1651
LPARAM lParam
Definition: combotst.c:139

◆ StartWindowProc()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
static LRESULT CALLBACK ATL::CContainedWindowT< TBase, TWinTraits >::StartWindowProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlinestatic

Definition at line 1703 of file atlwin.h.

1704  {
1705  CContainedWindowT<TBase> *pThis;
1706  WNDPROC newWindowProc;
1707  WNDPROC GCCU(pOldProc);
1708 
1709  pThis = reinterpret_cast<CContainedWindowT<TBase> *>(_AtlWinModule.ExtractCreateWndData());
1710  ATLASSERT(pThis != NULL);
1711  if (pThis == NULL)
1712  return 0;
1713  pThis->m_thunk.Init(WindowProc, pThis);
1714  newWindowProc = pThis->m_thunk.GetWNDPROC();
1715  pOldProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
1716  Unused(pOldProc); // TODO: should generate trace message if overwriting another subclass
1717  pThis->m_hWnd = hWnd;
1718  return newWindowProc(hWnd, uMsg, wParam, lParam);
1719  }
#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
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
#define GCCU(x)
Definition: atlwin.h:27
LPARAM lParam
Definition: combotst.c:139
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1721
#define Unused(x)
Definition: atlwin.h:28

◆ SubclassWindow()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
BOOL ATL::CContainedWindowT< TBase, TWinTraits >::SubclassWindow ( HWND  hWnd)
inline

Definition at line 1679 of file atlwin.h.

Referenced by CAddressEditBox::Init().

1680  {
1681  CContainedWindowT<TBase> *pThis;
1682  WNDPROC newWindowProc;
1683  WNDPROC oldWindowProc;
1684  BOOL result;
1685 
1686  ATLASSERT(m_hWnd == NULL);
1687  ATLASSERT(::IsWindow(hWnd));
1688 
1689  pThis = reinterpret_cast<CContainedWindowT<TBase> *>(this);
1690 
1691  result = m_thunk.Init(WindowProc, pThis);
1692  if (result == FALSE)
1693  return FALSE;
1694  newWindowProc = m_thunk.GetWNDPROC();
1695  oldWindowProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
1696  if (oldWindowProc == NULL)
1697  return FALSE;
1698  m_pfnSuperWindowProc = oldWindowProc;
1699  pThis->m_hWnd = hWnd;
1700  return TRUE;
1701  }
#define TRUE
Definition: types.h:120
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
HWND hWnd
Definition: settings.c:17
WNDPROC GetWNDPROC()
Definition: atlwin.h:244
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL Init(WNDPROC proc, void *pThis)
Definition: atlwin.h:236
CWndProcThunk m_thunk
Definition: atlwin.h:1649
smooth NULL
Definition: ftsmooth.c:416
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1651
GLuint64EXT * result
Definition: glext.h:11304
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1721

◆ WindowProc()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
static LRESULT CALLBACK ATL::CContainedWindowT< TBase, TWinTraits >::WindowProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlinestatic

Definition at line 1721 of file atlwin.h.

1722  {
1723  CContainedWindowT<TBase> *pThis = reinterpret_cast<CContainedWindowT<TBase> *>(hWnd);
1724  _ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
1725  LRESULT lResult;
1726  const _ATL_MSG *previousMessage;
1727  BOOL handled;
1728  LONG_PTR saveWindowProc;
1729 
1730  ATLASSERT(pThis != NULL && pThis->m_hWnd != NULL && pThis->m_pObject != NULL);
1731  if (pThis == NULL || pThis->m_hWnd == NULL || pThis->m_pObject == NULL)
1732  return 0;
1733 
1734  hWnd = pThis->m_hWnd;
1735  previousMessage = pThis->m_pCurrentMsg;
1736  pThis->m_pCurrentMsg = &msg;
1737 
1738  handled = pThis->m_pObject->ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, pThis->m_dwMsgMapID);
1739  ATLASSERT(pThis->m_pCurrentMsg == &msg);
1740 
1741  pThis->m_pCurrentMsg = previousMessage;
1742  if (handled == FALSE)
1743  {
1744  if (uMsg == WM_NCDESTROY)
1745  {
1746  saveWindowProc = ::GetWindowLongPtr(hWnd, GWLP_WNDPROC);
1747  lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
1748  if (pThis->m_pfnSuperWindowProc != ::DefWindowProc && saveWindowProc == ::GetWindowLongPtr(hWnd, GWLP_WNDPROC))
1749  ::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pThis->m_pfnSuperWindowProc));
1750  pThis->m_hWnd = NULL;
1751  }
1752  else
1753  lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
1754  }
1755  return lResult;
1756  }
#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
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
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1674
#define GWLP_WNDPROC
Definition: treelist.c:66
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define msg(x)
Definition: auth_time.c:54
#define GetWindowLongPtr
Definition: treelist.c:73
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

Member Data Documentation

◆ m_dwMsgMapID

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
DWORD ATL::CContainedWindowT< TBase, TWinTraits >::m_dwMsgMapID

Definition at line 1653 of file atlwin.h.

Referenced by ATL::CContainedWindowT< TBase, TWinTraits >::WindowProc().

◆ m_lpszClassName

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
LPCTSTR ATL::CContainedWindowT< TBase, TWinTraits >::m_lpszClassName

Definition at line 1650 of file atlwin.h.

◆ m_pCurrentMsg

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
const _ATL_MSG* ATL::CContainedWindowT< TBase, TWinTraits >::m_pCurrentMsg

Definition at line 1654 of file atlwin.h.

Referenced by ATL::CContainedWindowT< TBase, TWinTraits >::WindowProc().

◆ m_pfnSuperWindowProc

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
WNDPROC ATL::CContainedWindowT< TBase, TWinTraits >::m_pfnSuperWindowProc

Definition at line 1651 of file atlwin.h.

Referenced by ATL::CContainedWindowT< TBase, TWinTraits >::WindowProc().

◆ m_pObject

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
CMessageMap* ATL::CContainedWindowT< TBase, TWinTraits >::m_pObject

Definition at line 1652 of file atlwin.h.

Referenced by ATL::CContainedWindowT< TBase, TWinTraits >::WindowProc().

◆ m_thunk

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
CWndProcThunk ATL::CContainedWindowT< TBase, TWinTraits >::m_thunk

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