Windows2003-3790/admin/snapin/schmmgmt/cpropertypageautodelete.cpp
2020-09-30 16:53:55 +02:00

35 lines
683 B
C++

#include "stdafx.h"
#include <CPropertyPageAutoDelete.hpp>
UINT CALLBACK PropSheetPageProc
(
HWND hwnd,
UINT uMsg,
LPPROPSHEETPAGE ppsp
)
{
CPropertyPageAutoDelete* pPage = (CPropertyPageAutoDelete*)(ppsp->lParam);
if( pPage == NULL )
{
return 0;
}
UINT nResult = (*(pPage->m_pfnOldPropCallback))(hwnd, uMsg, ppsp);
if (uMsg == PSPCB_RELEASE)
{
delete pPage;
}
return nResult;
}
CPropertyPageAutoDelete::CPropertyPageAutoDelete
(
UINT nIDTemplate
):CPropertyPage(nIDTemplate)
{
m_pfnOldPropCallback = m_psp.pfnCallback;
m_psp.pfnCallback = PropSheetPageProc;
}