15,979
社区成员
发帖
与我相关
我的任务
分享
class CMyPage : CPropertyPage;
class CMySheet: CPropertySheet;
CMySheet* mySheet = new CMySheet();
CMyPage* myPage = new CMyPage();
mySheet->AddPage(myPage );
myPage->SetModified(TRUE)
进而调用其父类方法:
void CPropertyPage::SetModified(BOOL bChanged)
{
if (m_hWnd == NULL) // allowed for backward compatibility
return;
ASSERT(::IsWindow(m_hWnd));
ASSERT(GetParent() != NULL);
CWnd* pParentWnd = GetParent();
if (bChanged)
pParentWnd->SendMessage(PSM_CHANGED, (WPARAM)m_hWnd);
else
pParentWnd->SendMessage(PSM_UNCHANGED, (WPARAM)m_hWnd);
}
ON_MESSAGE (PSM_CHANGED, OnChanged)
LRESULT CMySheet::OnChanged(WPARAM, LPARAM)
{
m_bModified = TRUE;
return 0;
}
CWnd* pApplyButton = GetDlgItem (ID_APPLY_NOW);
ASSERT (pApplyButton);
pApplyButton->ShowWindow (SW_SHOW);