Редагувати

Поділитися через


PSM_CANCELTOCLOSE message

Sent by an application when it has performed changes since the most recent PSN_APPLY notification that cannot be canceled. You can send this message explicitly or by using the PropSheet_CancelToClose macro.

Parameters

wParam

Must be zero.

lParam

Must be zero.

Return value

No return value.

Remarks

PSM_CANCELTOCLOSE disables the Cancel button and changes the text of the OK button to "Close".

Most property sheets wait to perform irreversible changes until a PSN_APPLY notification is received. However, in some circumstances, a property sheet may make irreversible changes outside the standard PSN_APPLY/PSN_RESET sequence. One example is a property sheet that contains an Edit button that is used to display a subdialog box for editing a property. When the user clicks OK to submit the change, the property sheet page has several options.

  • It can record the changes, but wait until it receives a PSN_APPLY notification to apply them. This is the preferred approach.
  • It can apply the changes immediately after exiting the subdialog box, but remember the original settings. Those settings can be used to restore the original state if a PSN_RESET notification is received.
  • It can apply the changes immediately and not attempt to restore the original settings when it receives a PSN_RESET notification. This approach is not recommended, but may be necessary if the changes are too far-reaching for the other two options to be practical.

For the third option, applications should send a PSM_CANCELTOCLOSE message to the property sheet. It indicates to the user that the changes made with the subdialog box cannot be reversed by clicking the Cancel button.

Note

This message is not supported when using the Aero wizard style (PSH_AEROWIZARD).

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Prsht.h