mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 03:03:16 +00:00
[ATL] atlwin.h: Formatting, and add a comment in IsParentDialog().
This commit is contained in:
parent
fcc222c28a
commit
e60a4f00b5
1 changed files with 120 additions and 116 deletions
|
@ -60,7 +60,6 @@ namespace ATL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct _ATL_WNDCLASSINFOW;
|
struct _ATL_WNDCLASSINFOW;
|
||||||
typedef _ATL_WNDCLASSINFOW CWndClassInfo;
|
typedef _ATL_WNDCLASSINFOW CWndClassInfo;
|
||||||
|
|
||||||
|
@ -229,8 +228,8 @@ class CWndProcThunk
|
||||||
public:
|
public:
|
||||||
thunkCode *m_pthunk;
|
thunkCode *m_pthunk;
|
||||||
_AtlCreateWndData cd;
|
_AtlCreateWndData cd;
|
||||||
public:
|
|
||||||
|
|
||||||
|
public:
|
||||||
CWndProcThunk()
|
CWndProcThunk()
|
||||||
{
|
{
|
||||||
m_pthunk = (thunkCode*)VirtualAlloc(NULL, sizeof(thunkCode), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
m_pthunk = (thunkCode*)VirtualAlloc(NULL, sizeof(thunkCode), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||||
|
@ -267,6 +266,7 @@ class CWindow
|
||||||
public:
|
public:
|
||||||
HWND m_hWnd;
|
HWND m_hWnd;
|
||||||
static RECT rcDefault;
|
static RECT rcDefault;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CWindow(HWND hWnd = NULL)
|
CWindow(HWND hWnd = NULL)
|
||||||
{
|
{
|
||||||
|
@ -873,8 +873,8 @@ public:
|
||||||
BOOL IsParentDialog()
|
BOOL IsParentDialog()
|
||||||
{
|
{
|
||||||
ATLASSERT(::IsWindow(m_hWnd));
|
ATLASSERT(::IsWindow(m_hWnd));
|
||||||
TCHAR pszType[10];
|
TCHAR pszType[10]; // Use sizeof("#32770")+3 so that extra characters can be detected.
|
||||||
if (!RealGetWindowClass(::GetParent(m_hWnd), pszType, sizeof(pszType) / sizeof(pszType[0])))
|
if (!RealGetWindowClass(::GetParent(m_hWnd), pszType, _countof(pszType)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return !_tcscmp(pszType, _T("#32770"));
|
return !_tcscmp(pszType, _T("#32770"));
|
||||||
}
|
}
|
||||||
|
@ -1353,6 +1353,7 @@ public:
|
||||||
ATLASSERT(pThis != NULL);
|
ATLASSERT(pThis != NULL);
|
||||||
if (pThis == NULL)
|
if (pThis == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pThis->m_thunk.Init((WNDPROC)pThis->GetDialogProc(), pThis);
|
pThis->m_thunk.Init((WNDPROC)pThis->GetDialogProc(), pThis);
|
||||||
newDlgProc = reinterpret_cast<DLGPROC>(pThis->m_thunk.GetWNDPROC());
|
newDlgProc = reinterpret_cast<DLGPROC>(pThis->m_thunk.GetWNDPROC());
|
||||||
pOldProc = reinterpret_cast<DLGPROC>(::SetWindowLongPtr(hWnd, DWLP_DLGPROC, reinterpret_cast<LONG_PTR>(newDlgProc)));
|
pOldProc = reinterpret_cast<DLGPROC>(::SetWindowLongPtr(hWnd, DWLP_DLGPROC, reinterpret_cast<LONG_PTR>(newDlgProc)));
|
||||||
|
@ -1546,7 +1547,6 @@ public:
|
||||||
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
CWindowImplBaseT<TBase, TWinTraits>* pThis;
|
CWindowImplBaseT<TBase, TWinTraits>* pThis;
|
||||||
|
|
||||||
pThis = reinterpret_cast<CWindowImplBaseT<TBase, TWinTraits>*>(this);
|
pThis = reinterpret_cast<CWindowImplBaseT<TBase, TWinTraits>*>(this);
|
||||||
return ::CallWindowProc(m_pfnSuperWindowProc, pThis->m_hWnd, uMsg, wParam, lParam);
|
return ::CallWindowProc(m_pfnSuperWindowProc, pThis->m_hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
@ -1561,6 +1561,7 @@ public:
|
||||||
ATLASSERT(pThis != NULL);
|
ATLASSERT(pThis != NULL);
|
||||||
if (pThis == NULL)
|
if (pThis == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pThis->m_thunk.Init(pThis->GetWindowProc(), pThis);
|
pThis->m_thunk.Init(pThis->GetWindowProc(), pThis);
|
||||||
newWindowProc = pThis->m_thunk.GetWNDPROC();
|
newWindowProc = pThis->m_thunk.GetWNDPROC();
|
||||||
pOldProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
|
pOldProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(newWindowProc)));
|
||||||
|
@ -1605,8 +1606,10 @@ public:
|
||||||
pThis->m_dwState |= WINSTATE_DESTROYED;
|
pThis->m_dwState |= WINSTATE_DESTROYED;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
|
lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ATLASSERT(pThis->m_pCurrentMsg == &msg);
|
ATLASSERT(pThis->m_pCurrentMsg == &msg);
|
||||||
pThis->m_pCurrentMsg = previousMessage;
|
pThis->m_pCurrentMsg = previousMessage;
|
||||||
if (previousMessage == NULL && (pThis->m_dwState & WINSTATE_DESTROYED) != 0)
|
if (previousMessage == NULL && (pThis->m_dwState & WINSTATE_DESTROYED) != 0)
|
||||||
|
@ -1638,6 +1641,7 @@ public:
|
||||||
MenuOrID.m_hMenu = (HMENU)(UINT_PTR)this;
|
MenuOrID.m_hMenu = (HMENU)(UINT_PTR)this;
|
||||||
if (rect.m_lpRect == NULL)
|
if (rect.m_lpRect == NULL)
|
||||||
rect.m_lpRect = &TBase::rcDefault;
|
rect.m_lpRect = &TBase::rcDefault;
|
||||||
|
|
||||||
hWnd = ::CreateWindowEx(dwExStyle, MAKEINTATOM(atom), szWindowName, dwStyle, rect.m_lpRect->left,
|
hWnd = ::CreateWindowEx(dwExStyle, MAKEINTATOM(atom), szWindowName, dwStyle, rect.m_lpRect->left,
|
||||||
rect.m_lpRect->top, rect.m_lpRect->right - rect.m_lpRect->left, rect.m_lpRect->bottom - rect.m_lpRect->top,
|
rect.m_lpRect->top, rect.m_lpRect->right - rect.m_lpRect->left, rect.m_lpRect->bottom - rect.m_lpRect->top,
|
||||||
hWndParent, MenuOrID.m_hMenu, _AtlBaseModule.GetModuleInstance(), lpCreateParam);
|
hWndParent, MenuOrID.m_hMenu, _AtlBaseModule.GetModuleInstance(), lpCreateParam);
|
||||||
|
@ -1657,7 +1661,6 @@ public:
|
||||||
using CWindowImplRoot<TBase>::m_hWnd;
|
using CWindowImplRoot<TBase>::m_hWnd;
|
||||||
// - Hacks for gcc
|
// - Hacks for gcc
|
||||||
|
|
||||||
|
|
||||||
static LPCTSTR GetWndCaption()
|
static LPCTSTR GetWndCaption()
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1700,6 +1703,7 @@ public:
|
||||||
CMessageMap *m_pObject;
|
CMessageMap *m_pObject;
|
||||||
DWORD m_dwMsgMapID;
|
DWORD m_dwMsgMapID;
|
||||||
const _ATL_MSG *m_pCurrentMsg;
|
const _ATL_MSG *m_pCurrentMsg;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CContainedWindowT(CMessageMap *pObject, DWORD dwMsgMapID = 0)
|
CContainedWindowT(CMessageMap *pObject, DWORD dwMsgMapID = 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue