CPropertyPage::OnQueryCancel
Этот вызов платформой функции-члена, когда пользователь нажимает кнопку отмена и до отмены осуществляла действие.
virtual BOOL OnQueryCancel( );
Возвращаемое значение
Возвращает FALSE для предотвращения операцию отмены или TRUE, чтобы включить ее.
Заметки
Переопределите этот функцию-член, чтобы указать действие программы при нажатии пользователем кнопки отмена.
Реализация по умолчанию возвращений TRUEOnQueryCancel.
Пример
// Query the user whether to abort the changes if the new selected
// color (m_Color) is different from the initial color
// (m_InitialColor) when the CPropertySheet dialog is first shown.
// CColorPage is a CPropertyPage-derived class.
BOOL CColorPage::OnQueryCancel()
{
if (m_InitialColor != m_Color)
{
if (AfxMessageBox(_T("Abort the changes?"), MB_YESNO) == IDNO)
return FALSE;
}
return CPropertyPage::OnQueryCancel();
}
Требования
Header: afxdlgs.h