CSnapInPropertyPageImpl Class
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at CSnapInPropertyPageImpl Class.
This class provides methods for implementing a snap-in property page object.
重要
This class and its members cannot be used in applications that execute in the Windows Runtime.
CSnapInPropertyPageImpl : public CDialogImplBase
Name | Description |
---|---|
CSnapInPropertyPageImpl::CSnapInPropertyPageImpl | Constructor. |
Name | Description |
---|---|
CSnapInPropertyPageImpl::CancelToClose | Changes the status of the OK and Cancel buttons. |
CSnapInPropertyPageImpl::Create | Initializes a newly created CSnapInPropertyPageImpl object. |
CSnapInPropertyPageImpl::OnApply | Called by the framework when the user clicks the Apply Now button while using a wizard-type property sheet. |
CSnapInPropertyPageImpl::OnHelp | Called by the framework when the user clicks the Help button while using a wizard-type property sheet. |
CSnapInPropertyPageImpl::OnKillActive | Called by the framework when the current page is no longer active. |
CSnapInPropertyPageImpl::OnQueryCancel | Called by the framework when the user clicks the Cancel button and before the cancel has taken place. |
CSnapInPropertyPageImpl::OnReset | Called by the framework when the user clicks the Reset button while using a wizard-type property sheet. |
CSnapInPropertyPageImpl::OnSetActive | Called by the framework when the current page becomes active. |
CSnapInPropertyPageImpl::OnWizardBack | Called by the framework when the user clicks the Back button while using a wizard-type property sheet. |
CSnapInPropertyPageImpl::OnWizardFinish | Called by the framework when the user clicks the Finish button while using a wizard-type property sheet. |
CSnapInPropertyPageImpl::OnWizardNext | Called by the framework when the user clicks the Next button while using a wizard-type property sheet. |
CSnapInPropertyPageImpl::QuerySiblings | Forwards the current message to all pages of the property sheet. |
CSnapInPropertyPageImpl::SetModified | Call to activate or deactivate the Apply Now button. |
Name | Description |
---|---|
CSnapInPropertyPageImpl::m_psp | The Windows PROPSHEETPAGE structure used by the CSnapInPropertyPageImpl object. |
CSnapInPropertyPageImpl
provides a basic implementation for a snap-in property page object. The basic features of a snap-in property page are implemented using several different interfaces and map types.
CDialogImplBase
CSnapInPropertyPageImpl
Header: atlsnap.h
Call this function after an unrecoverable change has been made to the data in a page of a modal property sheet.
void CancelToClose();
This function will change the OK button to Close and disable the Cancel button. This change alerts the user that a change is permanent and the modifications cannot be cancelled.
The CancelToClose
member function does nothing in a modeless property sheet, because a modeless property sheet does not have a Cancel button by default.
Constructs a CSnapInPropertyPageImpl
object.
CSnapInPropertyPageImpl(LPCTSTR lpszTitle = NULL);
lpszTitle
[in] The title of the property page.
To initialize the underlying structure, call CSnapInPropertyPageImpl::Create.
Call this function to initialize the underlying structure of the property page.
HPROPSHEETPAGE Create();
A handle to a PROPSHEETPAGE structure containing the attributes of the newly created property sheet.
You should first call CSnapInPropertyPageImpl::CSnapInPropertyPageImpl before calling this function.
m_psp
is a structure whose members store the characteristics of PROPSHEETPAGE.
PROPSHEETPAGE m_psp;
Use this structure to initialize the appearance of a property page after it is constructed.
For more information on this structure, including a listing of its members, see PROPSHEETPAGE in the Windows SDK.
This member function is called when the user clicks the OK or the Apply Now button.
BOOL OnApply();
Nonzero if the changes are accepted; otherwise 0.
Before OnApply
can be called by the framework, you must have called SetModified
and set its parameter to TRUE. This will activate the Apply Now button as soon as the user makes a change on the property page.
Override this member function to specify what action your program takes when the user clicks the Apply Now button. When overriding, the function should return TRUE to accept changes and FALSE to prevent changes from taking effect.
The default implementation of OnApply
returns TRUE.
This member function is called when the user clicks the Help button for the property page.
void OnHelp();
Override this member function to display help for the property page.
This member function is called when the page is no longer the active page.
BOOL OnKillActive();
Nonzero if data was updated successfully; otherwise 0.
Override this member function to perform special data validation tasks.
This member function is called when the user clicks the Cancel button and before the cancel action has taken place.
BOOL OnQueryCancel();
Nonzero to allow the cancel operation; otherwise 0.
Override this member function to specify an action the program takes when the user clicks the Cancel button.
The default implementation of OnQueryCancel
returns TRUE.
This member function is called when the user clicks the Cancel button.
void OnReset();
When this function is called, changes to all property pages that were made by the user previously clicking the Apply Now button are discarded, and the property sheet retains focus.
Override this member function to specify what action the program takes when the user clicks the Cancel button.
This member function is called when the page is chosen by the user and becomes the active page.
BOOL OnSetActive();
Nonzero if the page was successfully set active; otherwise 0.
Override this member function to perform tasks when a page is activated. Your override of this member function should call the default version before any other processing is done.
The default implementation returns TRUE.
This member function is called when the user clicks the Back button in a wizard.
BOOL OnWizardBack();
0 to automatically advance to the previous page.
–1 to prevent the page from changing.
To jump to a page other than the next one, return the identifier of the dialog box to be displayed.
Override this member function to specify some action the user must take when the Back button is clicked.
This member function is called when the user clicks the Finish button in a wizard.
BOOL OnWizardFinish();
Nonzero if the property sheet is destroyed when the wizard finishes; otherwise zero.
Override this member function to specify some action the user must take when the Finish button is clicked.
This member function is called when the user clicks the Next
button in a wizard.
BOOL OnWizardNext();
0 to automatically advance to the next page.
–1 to prevent the page from changing.
To jump to a page other than the next one, return the identifier of the dialog box to be displayed.
Override this member function to specify some action the user must take when the Next
button is clicked.
Call this member function to forward a message to each page in the property sheet.
LRESULT QuerySiblings(WPARAM wParam, LPARAM lParam);
wParam
[in] Specifies additional message-dependent information.
lParam
[in] Specifies additional message-dependent information.
Nonzero if the message should not be forwarded to the next property page; otherwise zero.
If a page returns a nonzero value, the property sheet does not send the message to subsequent pages.
Call this member function to enable or disable the Apply Now button, based on whether the settings in the property page should be applied to the appropriate external object.
void SetModified(BOOL bChanged = TRUE);
bChanged
[in] TRUE to indicate that the property page settings have been modified since the last time they were applied; FALSE to indicate that the property page settings have been applied, or should be ignored.
The property sheet keeps track of which pages are "dirty," that is, property pages for which you have called SetModified( TRUE ). The Apply Now button will always be enabled if you call SetModified( TRUE ) for one of the pages. The Apply Now button will be disabled when you call SetModified( FALSE ) for one of the pages, but only if none of the other pages is "dirty."