From 3f95d417d9e623ac0c74df8ef11d7a01846392dd Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Sep 2003 19:07:23 +0000 Subject: Initial Import --- NSCmpts/PromptClose.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 NSCmpts/PromptClose.h (limited to 'NSCmpts/PromptClose.h') diff --git a/NSCmpts/PromptClose.h b/NSCmpts/PromptClose.h new file mode 100644 index 0000000..a10c058 --- /dev/null +++ b/NSCmpts/PromptClose.h @@ -0,0 +1,51 @@ +// PromptClose.h: interface for the CPromptClose class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_PROMPTCLOSE_H__5BB78C71_C041_11D3_8306_005056C1D336__INCLUDED_) +#define AFX_PROMPTCLOSE_H__5BB78C71_C041_11D3_8306_005056C1D336__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include + +template +class CPromptCloseT : public CWindowImplBaseT< TBase > +{ +public: + CPromptCloseT() + { + m_nIDRet = IDCANCEL; + } + + bool CloseNext(UINT nRet) + { + m_nIDRet = nRet; + _Module.AddCreateWndData(&m_thunk.cd, this); + return HOOK_AND_SUBCLASS_NEXT() ? true : false; + } + + +BEGIN_MSG_MAP(CPromptCloseT) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) +END_MSG_MAP() + + DECLARE_HOOK_AND_SUBCLASS(CPromptCloseT) + + LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) + { + EndDialog(m_hWnd, m_nIDRet); + UnsubclassWindow(); + // Hide this Dialog + return TRUE; + } + +protected: + UINT m_nIDRet; +}; + +typedef CPromptCloseT CPromptClose; + +#endif // !defined(AFX_PROMPTCLOSE_H__5BB78C71_C041_11D3_8306_005056C1D336__INCLUDED_) -- cgit v1.2.3