ReactOS  0.4.15-dev-1070-ge1a01de
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 1661 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 1675 of file atlwin.h.

1676  {
1677  m_lpszClassName = TBase::GetWndClassName();
1679  m_pObject = pObject;
1680  m_dwMsgMapID = dwMsgMapID;
1681  m_pCurrentMsg = NULL;
1682  }
const _ATL_MSG * m_pCurrentMsg
Definition: atlwin.h:1673
smooth NULL
Definition: ftsmooth.c:416
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1693
CMessageMap * m_pObject
Definition: atlwin.h:1671
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1670
LPCTSTR m_lpszClassName
Definition: atlwin.h:1669

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

1685  {
1686  m_lpszClassName = lpszClassName;
1688  m_pObject = pObject;
1689  m_dwMsgMapID = dwMsgMapID;
1690  m_pCurrentMsg = NULL;
1691  }
const _ATL_MSG * m_pCurrentMsg
Definition: atlwin.h:1673
smooth NULL
Definition: ftsmooth.c:416
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1693
CMessageMap * m_pObject
Definition: atlwin.h:1671
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1670
LPCTSTR m_lpszClassName
Definition: atlwin.h:1669

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

1694  {
1696  }
#define CallWindowProc
Definition: winuser.h:5710
WPARAM wParam
Definition: combotst.c:138
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1670
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 1722 of file atlwin.h.

1723  {
1724  CContainedWindowT<TBase> *pThis;
1725  WNDPROC newWindowProc;
1726  WNDPROC GCCU(pOldProc);
1727 
1728  pThis = reinterpret_cast<CContainedWindowT<TBase> *>(_AtlWinModule.ExtractCreateWndData());
1729  ATLASSERT(pThis != NULL);
1730  if (pThis == NULL)
1731  return 0;
1732  pThis->m_thunk.Init(WindowProc, pThis);
1733  newWindowProc = pThis->m_thunk.GetWNDPROC();
1734  pOldProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
1735  Unused(pOldProc); // TODO: should generate trace message if overwriting another subclass
1736  pThis->m_hWnd = hWnd;
1737  return newWindowProc(hWnd, uMsg, wParam, lParam);
1738  }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
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:2881
#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:1740
#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 1698 of file atlwin.h.

1699  {
1700  CContainedWindowT<TBase> *pThis;
1701  WNDPROC newWindowProc;
1702  WNDPROC oldWindowProc;
1703  BOOL result;
1704 
1705  ATLASSERT(m_hWnd == NULL);
1706  ATLASSERT(::IsWindow(hWnd));
1707 
1708  pThis = reinterpret_cast<CContainedWindowT<TBase> *>(this);
1709 
1710  result = m_thunk.Init(WindowProc, pThis);
1711  if (result == FALSE)
1712  return FALSE;
1713  newWindowProc = m_thunk.GetWNDPROC();
1714  oldWindowProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
1715  if (oldWindowProc == NULL)
1716  return FALSE;
1717  m_pfnSuperWindowProc = oldWindowProc;
1718  pThis->m_hWnd = hWnd;
1719  return TRUE;
1720  }
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define TRUE
Definition: types.h:120
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:1668
#define FALSE
Definition: types.h:117
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:2881
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1670
GLuint64EXT * result
Definition: glext.h:11304
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1740

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

1741  {
1742  CContainedWindowT<TBase> *pThis = reinterpret_cast<CContainedWindowT<TBase> *>(hWnd);
1743  _ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
1744  LRESULT lResult;
1745  const _ATL_MSG *previousMessage;
1746  BOOL handled;
1747  LONG_PTR saveWindowProc;
1748 
1749  ATLASSERT(pThis != NULL && pThis->m_hWnd != NULL && pThis->m_pObject != NULL);
1750  if (pThis == NULL || pThis->m_hWnd == NULL || pThis->m_pObject == NULL)
1751  return 0;
1752 
1753  hWnd = pThis->m_hWnd;
1754  previousMessage = pThis->m_pCurrentMsg;
1755  pThis->m_pCurrentMsg = &msg;
1756 
1757  handled = pThis->m_pObject->ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, pThis->m_dwMsgMapID);
1758  ATLASSERT(pThis->m_pCurrentMsg == &msg);
1759 
1760  pThis->m_pCurrentMsg = previousMessage;
1761  if (handled == FALSE)
1762  {
1763  if (uMsg == WM_NCDESTROY)
1764  {
1765  saveWindowProc = ::GetWindowLongPtr(hWnd, GWLP_WNDPROC);
1766  lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
1767  if (pThis->m_pfnSuperWindowProc != ::DefWindowProc && saveWindowProc == ::GetWindowLongPtr(hWnd, GWLP_WNDPROC))
1768  ::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pThis->m_pfnSuperWindowProc));
1769  pThis->m_hWnd = NULL;
1770  }
1771  else
1772  lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
1773  }
1774  return lResult;
1775  }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HWND hWnd
Definition: settings.c:17
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
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:1693
#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: