ReactOS 0.4.17-dev-1321-g5c122a9
ATL::CWindowImplBaseT< TBase, TWinTraits > Class Template Reference

#include <atlwin.h>

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

Public Member Functions

 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
HWND UnsubclassWindow (BOOL bForce=FALSE)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< TBase >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CWindow
 CWindow (HWND hWnd=NULL)
 
 operator HWND () const
 
UINT ArrangeIconicWindows ()
 
void Attach (HWND hWndNew)
 
HDC BeginPaint (LPPAINTSTRUCT lpPaint)
 
BOOL BringWindowToTop ()
 
BOOL CenterWindow (HWND hWndCenter=NULL)
 
BOOL ChangeClipboardChain (HWND hWndNewNext)
 
BOOL CheckDlgButton (int nIDButton, UINT nCheck)
 
BOOL CheckRadioButton (int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 
HWND ChildWindowFromPoint (POINT point) const
 
HWND ChildWindowFromPointEx (POINT point, UINT uFlags) const
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (LPRECT lpRect) const
 
HWND Create (LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
BOOL CreateCaret (HBITMAP pBitmap)
 
BOOL CreateGrayCaret (int nWidth, int nHeight)
 
BOOL CreateSolidCaret (int nWidth, int nHeight)
 
HDWP DeferWindowPos (HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
 
BOOL DestroyWindow ()
 
HWND Detach ()
 
int DlgDirList (LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType)
 
int DlgDirListComboBox (LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType)
 
BOOL DlgDirSelect (LPTSTR lpString, int nCount, int nIDListBox)
 
BOOL DlgDirSelectComboBox (LPTSTR lpString, int nCount, int nIDComboBox)
 
void DragAcceptFiles (BOOL bAccept=TRUE)
 
BOOL DrawMenuBar ()
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL EnableWindow (BOOL bEnable=TRUE)
 
void EndPaint (LPPAINTSTRUCT lpPaint)
 
BOOL FlashWindow (BOOL bInvert)
 
BOOL GetClientRect (LPRECT lpRect) const
 
HDC GetDC ()
 
HDC GetDCEx (HRGN hRgnClip, DWORD flags)
 
HWND GetDescendantWindow (int nID) const
 
HRESULT GetDlgControl (int nID, REFIID iid, void **ppCtrl)
 
int GetDlgCtrlID () const
 
HRESULT GetDlgHost (int nID, REFIID iid, void **ppHost)
 
HWND GetDlgItem (_In_ int nID) const
 
UINT GetDlgItemInt (_In_ int nID, _Out_opt_ BOOL *lpTrans=NULL, _In_ BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (_In_ int nID, _Out_writes_to_(nMaxCount, return+1) LPTSTR lpStr, _In_ int nMaxCount) const
 
BOOL GetDlgItemText (_In_ int nID, _Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
DWORD GetExStyle () const
 
HFONT GetFont () const
 
DWORD GetHotKey () const
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
HWND GetLastActivePopup () const
 
HMENU GetMenu () const
 
HWND GetNextDlgGroupItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
HWND GetNextDlgTabItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
CWindow GetParent () const
 
BOOL GetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo)
 
BOOL GetScrollPos (int nBar)
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
DWORD GetStyle () const
 
HMENU GetSystemMenu (BOOL bRevert)
 
HWND GetTopLevelParent () const
 
HWND GetTopLevelWindow () const
 
HWND GetTopWindow () const
 
BOOL GetUpdateRect (LPRECT lpRect, BOOL bErase=FALSE)
 
int GetUpdateRgn (HRGN hRgn, BOOL bErase=FALSE)
 
HWND GetWindow (UINT nCmd) const
 
DWORD GetWindowContextHelpId () const
 
HDC GetWindowDC ()
 
LONG GetWindowLong (int nIndex) const
 
LONG_PTR GetWindowLongPtr (int nIndex) const
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
DWORD GetWindowProcessID ()
 
BOOL GetWindowRect (LPRECT lpRect) const
 
int GetWindowRgn (HRGN hRgn)
 
int GetWindowText (_Out_writes_to_(nMaxCount, return+1) LPTSTR lpszStringBuf, _In_ int nMaxCount) const
 
BOOL GetWindowText (_Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
int GetWindowTextLength () const
 
DWORD GetWindowThreadID ()
 
WORD GetWindowWord (int nIndex) const
 
void GotoDlgCtrl (HWND hWndCtrl) const
 
BOOL HideCaret ()
 
BOOL HiliteMenuItem (HMENU hMenu, UINT uHiliteItem, UINT uHilite)
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsChild (const HWND hWnd) const
 
BOOL IsDialogMessage (LPMSG lpMsg)
 
UINT IsDlgButtonChecked (int nIDButton) const
 
BOOL IsIconic () const
 
BOOL IsParentDialog ()
 
BOOL IsWindow () const
 
BOOL IsWindowEnabled () const
 
BOOL IsWindowVisible () const
 
BOOL IsWindowUnicode ()
 
BOOL IsZoomed () const
 
BOOL KillTimer (UINT_PTR nIDEvent)
 
BOOL LockWindowUpdate (BOOL bLock=TRUE)
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
 
int MapWindowPoints (HWND hWndTo, LPRECT lpRect) const
 
int MessageBox (LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
 
void NextDlgCtrl () const
 
BOOL OpenClipboard ()
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void PrevDlgCtrl () const
 
void Print (HDC hDC, DWORD dwFlags) const
 
void PrintClient (HDC hDC, DWORD dwFlags) const
 
BOOL RedrawWindow (LPCRECT lpRectUpdate=NULL, HRGN hRgnUpdate=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
int ReleaseDC (HDC hDC)
 
BOOL ResizeClient (int nWidth, int nHeight, BOOL bRedraw=FALSE)
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScrollWindow (int xAmount, int yAmount, LPCRECT lpRect=NULL, LPCRECT lpClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags)
 
LRESULT SendDlgItemMessage (int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void SendMessageToDescendants (UINT message, WPARAM wParam=0, LPARAM lParam=0, BOOL bDeep=TRUE)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
HWND SetActiveWindow ()
 
HWND SetCapture ()
 
HWND SetClipboardViewer ()
 
int SetDlgCtrlID (int nID)
 
BOOL SetDlgItemInt (int nID, UINT nValue, BOOL bSigned=TRUE)
 
BOOL SetDlgItemText (int nID, LPCTSTR lpszString)
 
HWND SetFocus ()
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
int SetHotKey (WORD wVirtualKeyCode, WORD wModifiers)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
BOOL SetMenu (HMENU hMenu)
 
HWND SetParent (HWND hWndNewParent)
 
void SetRedraw (BOOL bRedraw=TRUE)
 
int SetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw=TRUE)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
 
BOOL SetWindowContextHelpId (DWORD dwContextHelpId)
 
LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong)
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetWindowText (LPCTSTR lpszString)
 
WORD SetWindowWord (int nIndex, WORD wNewWord)
 
BOOL ShowCaret ()
 
BOOL ShowOwnedPopups (BOOL bShow=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL ShowWindow (int nCmdShow)
 
BOOL ShowWindowAsync (int nCmdShow)
 
BOOL UpdateWindow ()
 
BOOL ValidateRect (LPCRECT lpRect)
 
BOOL ValidateRgn (HRGN hRgn)
 
BOOL WinHelp (LPCTSTR lpszHelp, UINT nCmd=HELP_CONTEXT, DWORD dwData=0)
 
- 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 DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Public Attributes

WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSG * m_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

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

Definition at line 1557 of file atlwin.h.

Constructor & Destructor Documentation

◆ CWindowImplBaseT()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
ATL::CWindowImplBaseT< TBase, TWinTraits >::CWindowImplBaseT ( )
inline

Definition at line 1569 of file atlwin.h.

1570 {
1572 }
WNDPROC m_pfnSuperWindowProc
Definition: atlwin.h:1566
#define DefWindowProc
Definition: ros2win.h:31

Member Function Documentation

◆ Create()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
HWND ATL::CWindowImplBaseT< TBase, TWinTraits >::Create ( HWND  hWndParent,
_U_RECT  rect,
LPCTSTR  szWindowName,
DWORD  dwStyle,
DWORD  dwExStyle,
_U_MENUorID  MenuOrID,
ATOM  atom,
LPVOID  lpCreateParam 
)
inline

Definition at line 1715 of file atlwin.h.

1717 {
1718 HWND hWnd;
1719
1720 ATLASSERT(m_hWnd == NULL);
1721 ATLASSERT(atom != 0);
1722 if (atom == 0)
1723 return NULL;
1724 if (m_thunk.Init(NULL, NULL) == FALSE)
1725 {
1727 return NULL;
1728 }
1729
1730 _AtlWinModule.AddCreateWndData(&m_thunk.cd, this);
1731 if (MenuOrID.m_hMenu == NULL && (dwStyle & WS_CHILD) != 0)
1732 MenuOrID.m_hMenu = (HMENU)(UINT_PTR)this;
1733 if (rect.m_lpRect == NULL)
1734 rect.m_lpRect = &TBase::rcDefault;
1735
1736 hWnd = ::CreateWindowEx(dwExStyle, MAKEINTATOM(atom), szWindowName, dwStyle, rect.m_lpRect->left,
1737 rect.m_lpRect->top, rect.m_lpRect->right - rect.m_lpRect->left, rect.m_lpRect->bottom - rect.m_lpRect->top,
1738 hWndParent, MenuOrID.m_hMenu, _AtlBaseModule.GetModuleInstance(), lpCreateParam);
1739
1740 ATLASSERT(m_hWnd == hWnd);
1741
1742 return hWnd;
1743 }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
HWND hWnd
Definition: settings.c:17
CWndProcThunk m_thunk
Definition: atlwin.h:1405
HWND m_hWnd
Definition: atlwin.h:299
_AtlCreateWndData cd
Definition: atlwin.h:262
BOOL Init(WNDPROC proc, void *pThis)
Definition: atlwin.h:276
RECT rect
Definition: combotst.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:752
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define WS_CHILD
Definition: pedump.c:617
#define CreateWindowEx
Definition: winuser.h:5921
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
#define MAKEINTATOM(i)
Definition: winbase.h:1196

Referenced by ATL::CWindowImpl< T, TBase, TWinTraits >::Create().

◆ DefWindowProc()

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

Definition at line 1638 of file atlwin.h.

1639 {
1640 CWindowImplBaseT<TBase, TWinTraits>* pThis;
1641 pThis = reinterpret_cast<CWindowImplBaseT<TBase, TWinTraits>*>(this);
1642 return ::CallWindowProc(m_pfnSuperWindowProc, pThis->m_hWnd, uMsg, wParam, lParam);
1643 }
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139

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

◆ GetWindowProc()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
virtual WNDPROC ATL::CWindowImplBaseT< TBase, TWinTraits >::GetWindowProc ( )
inlinevirtual

Reimplemented in CShellBrowser, and CDefView.

Definition at line 1623 of file atlwin.h.

1624 {
1625 return WindowProc;
1626 }
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1664

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

◆ GetWndExStyle()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
static DWORD ATL::CWindowImplBaseT< TBase, TWinTraits >::GetWndExStyle ( DWORD  dwExStyle)
inlinestatic

Definition at line 1633 of file atlwin.h.

1634 {
1635 return TWinTraits::GetWndExStyle(dwExStyle);
1636 }

◆ GetWndStyle()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
static DWORD ATL::CWindowImplBaseT< TBase, TWinTraits >::GetWndStyle ( DWORD  dwStyle)
inlinestatic

Definition at line 1628 of file atlwin.h.

1629 {
1630 return TWinTraits::GetWndStyle(dwStyle);
1631 }

◆ OnFinalMessage()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
virtual void ATL::CWindowImplBaseT< TBase, TWinTraits >::OnFinalMessage ( HWND  )
inlinevirtual

Reimplemented in CChangeNotifyBroker, and CDefView.

Definition at line 1574 of file atlwin.h.

1575 {
1576 }

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

◆ StartWindowProc()

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

Definition at line 1645 of file atlwin.h.

1646 {
1647 CWindowImplBaseT<TBase, TWinTraits>* pThis;
1648 WNDPROC newWindowProc;
1649 WNDPROC GCCU(pOldProc);
1650
1651 pThis = reinterpret_cast<CWindowImplBaseT<TBase, TWinTraits>*>(_AtlWinModule.ExtractCreateWndData());
1652 ATLASSERT(pThis != NULL);
1653 if (pThis == NULL)
1654 return 0;
1655
1656 pThis->m_thunk.Init(pThis->GetWindowProc(), pThis);
1657 newWindowProc = pThis->m_thunk.GetWNDPROC();
1658 pOldProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
1659 Unused(pOldProc); // TODO: should generate trace message if overwriting another subclass
1660 pThis->m_hWnd = hWnd;
1661 return newWindowProc(hWnd, uMsg, wParam, lParam);
1662 }
#define GCCU(x)
Definition: atlwin.h:27
#define Unused(x)
Definition: atlwin.h:28
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_WNDPROC
Definition: treelist.c:66

Referenced by CAppScrnshotPreview::GetWndClassInfo(), CMainWindow::GetWndClassInfo(), CShellBrowser::GetWndClassInfo(), and CDefView::GetWndClassInfo().

◆ SubclassWindow()

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

Definition at line 1578 of file atlwin.h.

1579 {
1580 ATLASSERT(m_hWnd == NULL);
1582
1583 CWindowImplBaseT<TBase, TWinTraits>* pThis;
1584 pThis = reinterpret_cast<CWindowImplBaseT<TBase, TWinTraits>*>(this);
1585
1587 if (result == FALSE)
1588 return FALSE;
1589
1590 WNDPROC newWindowProc = m_thunk.GetWNDPROC();
1591 WNDPROC oldWindowProc = reinterpret_cast<WNDPROC>(
1592 ::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
1593 if (oldWindowProc == NULL)
1594 return FALSE;
1595
1596 pThis->m_pfnSuperWindowProc = oldWindowProc;
1597 pThis->m_hWnd = hWnd;
1598 return TRUE;
1599 }
virtual WNDPROC GetWindowProc()
Definition: atlwin.h:1623
BOOL IsWindow() const
Definition: atlwin.h:973
WNDPROC GetWNDPROC()
Definition: atlwin.h:284
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint64EXT * result
Definition: glext.h:11304

Referenced by CreateNotificationBroker(), and CDownloadManager::RealDlgProc().

◆ UnsubclassWindow()

template<class TBase = CWindow, class TWinTraits = CControlWinTraits>
HWND ATL::CWindowImplBaseT< TBase, TWinTraits >::UnsubclassWindow ( BOOL  bForce = FALSE)
inline

Definition at line 1601 of file atlwin.h.

1602 {
1603 ATLASSERT(m_hWnd != NULL);
1605
1606 CWindowImplBaseT<TBase, TWinTraits>* pThis;
1607 pThis = reinterpret_cast<CWindowImplBaseT<TBase, TWinTraits>*>(this);
1608
1609 HWND hwndOld = pThis->m_hWnd;
1610 WNDPROC oldWindowProc = m_thunk.GetWNDPROC();
1611 WNDPROC subclassedProc = reinterpret_cast<WNDPROC>(
1613 if (!bForce && oldWindowProc != subclassedProc)
1614 return NULL;
1615
1617 (LONG_PTR)pThis->m_pfnSuperWindowProc);
1618 pThis->m_pfnSuperWindowProc = ::DefWindowProc;
1619 pThis->m_hWnd = NULL;
1620 return hwndOld;
1621 }
#define GetWindowLongPtr
Definition: treelist.c:73

Referenced by CFindFolder::MessageSFVCB(), and CDownloadManager::RealDlgProc().

◆ WindowProc()

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

Definition at line 1664 of file atlwin.h.

1665 {
1666 CWindowImplBaseT<TBase, TWinTraits>* pThis = reinterpret_cast<CWindowImplBaseT< TBase, TWinTraits>*>(hWnd);
1667 _ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
1668 LRESULT lResult;
1669 const _ATL_MSG *previousMessage;
1670 BOOL handled;
1671 LONG_PTR saveWindowProc;
1672
1673 ATLASSERT(pThis != NULL);
1674 if (pThis == NULL)
1675 return 0;
1676
1677 ATLASSERT((pThis->m_dwState & WINSTATE_DESTROYED) == 0);
1678 ATLASSERT(pThis->m_hWnd != NULL);
1679 if ((pThis->m_dwState & WINSTATE_DESTROYED) != 0 || pThis->m_hWnd == NULL)
1680 return 0;
1681
1682 hWnd = pThis->m_hWnd;
1683 previousMessage = pThis->m_pCurrentMsg;
1684 pThis->m_pCurrentMsg = &msg;
1685
1686 handled = pThis->ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, 0);
1687 ATLASSERT(pThis->m_pCurrentMsg == &msg);
1688
1689 if (handled == FALSE)
1690 {
1691 if (uMsg == WM_NCDESTROY)
1692 {
1693 saveWindowProc = ::GetWindowLongPtr(hWnd, GWLP_WNDPROC);
1694 lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
1695 if (pThis->m_pfnSuperWindowProc != ::DefWindowProc && saveWindowProc == ::GetWindowLongPtr(hWnd, GWLP_WNDPROC))
1696 ::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pThis->m_pfnSuperWindowProc));
1697 pThis->m_dwState |= WINSTATE_DESTROYED;
1698 }
1699 else
1700 {
1701 lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
1702 }
1703 }
1704 ATLASSERT(pThis->m_pCurrentMsg == &msg);
1705 pThis->m_pCurrentMsg = previousMessage;
1706 if (previousMessage == NULL && (pThis->m_dwState & WINSTATE_DESTROYED) != 0)
1707 {
1708 pThis->m_dwState &= ~WINSTATE_DESTROYED;
1709 pThis->m_hWnd = NULL;
1710 pThis->OnFinalMessage(hWnd);
1711 }
1712 return lResult;
1713 }
#define msg(x)
Definition: auth_time.c:54
LONG_PTR LRESULT
Definition: minwindef.h:176
#define WM_NCDESTROY
Definition: winuser.h:1712

Referenced by ATL::CWindowImplBaseT< TBase, TWinTraits >::GetWindowProc().

Member Data Documentation

◆ m_pfnSuperWindowProc


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