ReactOS  0.4.13-dev-235-g7373cb3
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 1655 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 1665 of file atlwin.h.

1666  {
1667  m_lpszClassName = TBase::GetWndClassName();
1669  m_pObject = pObject;
1670  m_dwMsgMapID = dwMsgMapID;
1671  m_pCurrentMsg = NULL;
1672  }
const _ATL_MSG * m_pCurrentMsg
Definition: atlwin.h:1663
smooth NULL
Definition: ftsmooth.c:416
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1683
CMessageMap * m_pObject
Definition: atlwin.h:1661
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1660
LPCTSTR m_lpszClassName
Definition: atlwin.h:1659

◆ 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 1674 of file atlwin.h.

1675  {
1676  m_lpszClassName = lpszClassName;
1678  m_pObject = pObject;
1679  m_dwMsgMapID = dwMsgMapID;
1680  m_pCurrentMsg = NULL;
1681  }
const _ATL_MSG * m_pCurrentMsg
Definition: atlwin.h:1663
smooth NULL
Definition: ftsmooth.c:416
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1683
CMessageMap * m_pObject
Definition: atlwin.h:1661
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1660
LPCTSTR m_lpszClassName
Definition: atlwin.h:1659

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 1683 of file atlwin.h.

1684  {
1686  }
#define CallWindowProc
Definition: winuser.h:5601
WPARAM wParam
Definition: combotst.c:138
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1660
LPARAM lParam
Definition: combotst.c:139

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

◆ 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 1712 of file atlwin.h.

1713  {
1714  CContainedWindowT<TBase> *pThis;
1715  WNDPROC newWindowProc;
1716  WNDPROC GCCU(pOldProc);
1717 
1718  pThis = reinterpret_cast<CContainedWindowT<TBase> *>(_AtlWinModule.ExtractCreateWndData());
1719  ATLASSERT(pThis != NULL);
1720  if (pThis == NULL)
1721  return 0;
1722  pThis->m_thunk.Init(WindowProc, pThis);
1723  newWindowProc = pThis->m_thunk.GetWNDPROC();
1724  pOldProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
1725  Unused(pOldProc); // TODO: should generate trace message if overwriting another subclass
1726  pThis->m_hWnd = hWnd;
1727  return newWindowProc(hWnd, uMsg, wParam, lParam);
1728  }
#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
#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:1730
#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 1688 of file atlwin.h.

1689  {
1690  CContainedWindowT<TBase> *pThis;
1691  WNDPROC newWindowProc;
1692  WNDPROC oldWindowProc;
1693  BOOL result;
1694 
1695  ATLASSERT(m_hWnd == NULL);
1696  ATLASSERT(::IsWindow(hWnd));
1697 
1698  pThis = reinterpret_cast<CContainedWindowT<TBase> *>(this);
1699 
1700  result = m_thunk.Init(WindowProc, pThis);
1701  if (result == FALSE)
1702  return FALSE;
1703  newWindowProc = m_thunk.GetWNDPROC();
1704  oldWindowProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
1705  if (oldWindowProc == NULL)
1706  return FALSE;
1707  m_pfnSuperWindowProc = oldWindowProc;
1708  pThis->m_hWnd = hWnd;
1709  return TRUE;
1710  }
#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:253
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL Init(WNDPROC proc, void *pThis)
Definition: atlwin.h:245
CWndProcThunk m_thunk
Definition: atlwin.h:1658
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1660
GLuint64EXT * result
Definition: glext.h:11304
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1730

Referenced by CAddressEditBox::Init().

◆ 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 1730 of file atlwin.h.

1731  {
1732  CContainedWindowT<TBase> *pThis = reinterpret_cast<CContainedWindowT<TBase> *>(hWnd);
1733  _ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
1734  LRESULT lResult;
1735  const _ATL_MSG *previousMessage;
1736  BOOL handled;
1737  LONG_PTR saveWindowProc;
1738 
1739  ATLASSERT(pThis != NULL && pThis->m_hWnd != NULL && pThis->m_pObject != NULL);
1740  if (pThis == NULL || pThis->m_hWnd == NULL || pThis->m_pObject == NULL)
1741  return 0;
1742 
1743  hWnd = pThis->m_hWnd;
1744  previousMessage = pThis->m_pCurrentMsg;
1745  pThis->m_pCurrentMsg = &msg;
1746 
1747  handled = pThis->m_pObject->ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, pThis->m_dwMsgMapID);
1748  ATLASSERT(pThis->m_pCurrentMsg == &msg);
1749 
1750  pThis->m_pCurrentMsg = previousMessage;
1751  if (handled == FALSE)
1752  {
1753  if (uMsg == WM_NCDESTROY)
1754  {
1755  saveWindowProc = ::GetWindowLongPtr(hWnd, GWLP_WNDPROC);
1756  lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
1757  if (pThis->m_pfnSuperWindowProc != ::DefWindowProc && saveWindowProc == ::GetWindowLongPtr(hWnd, GWLP_WNDPROC))
1758  ::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pThis->m_pfnSuperWindowProc));
1759  pThis->m_hWnd = NULL;
1760  }
1761  else
1762  lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
1763  }
1764  return lResult;
1765  }
#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
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define WM_NCDESTROY
Definition: winuser.h:1666
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1683
#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

Referenced by ATL::CContainedWindowT< TBase, TWinTraits >::StartWindowProc(), and ATL::CContainedWindowT< TBase, TWinTraits >::SubclassWindow().

Member Data Documentation

◆ m_dwMsgMapID

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

◆ m_lpszClassName

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

◆ m_pCurrentMsg

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

◆ m_pfnSuperWindowProc

◆ m_pObject

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

◆ 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: