// ExtraPage.cpp : implementation file // #include "stdafx.h" #include "ExtraPage.h" #include ///////////////////////////////////////////////////////////////////////////// // CExtraPage property page ///////////////////////////////////////////////////////////////////////////// // CExtraPage message handlers LRESULT CExtraPage::OnSetActive(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) { ASSERT(m_pComponent != NULL); m_pParentSheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT); return m_pComponent->IsEnabled() ? 0 : -1; } LRESULT CExtraPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { // Set the Proppage Rectangle to the Place Holder ::GetWindowRect(GetDlgItem(IDC_PROPHOLDER), &m_rcPropPage); ScreenToClient(&m_rcPropPage); // Remove Place Holder Control ::DestroyWindow(GetDlgItem(IDC_PROPHOLDER)); string sFormat; GetDlgItemText(IDC_HEADERTEXT, sFormat.get_buffer(512), 512); sFormat.release_buffer(); string sText; sText.format(sFormat, (LPCTSTR)m_pComponent->GetName()); SetDlgItemText(IDC_HEADERTEXT, sText); m_pPropPage->Create(*this, m_rcPropPage, true); SetWindowLong(GWL_EXSTYLE, GetWindowLong(GWL_EXSTYLE) & WS_EX_CONTROLPARENT); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } LRESULT CExtraPage::OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) { // If we have a PropPage then Save it if(m_pPropPage != NULL) m_pPropPage->Apply(); return FALSE; } LRESULT CExtraPage::OnHelp(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) { WinHelp(NS_HELP_FILE, HELP_FINDER, 0); return 1; } LRESULT CExtraPage::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { // If we have a PropPage then Close it if(m_pPropPage != NULL) m_pPropPage->Destroy(); return 0; }