// 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_)