The PSN_QUERYCANCEL notification message indicates that the user chose the Cancel button. This notification message is sent in the form of a WM_NOTIFY message.
PSN_QUERYCANCEL lpnmhdr = (NMHDR FAR *) lParam;
Returns TRUE to prevent the cancel operation or FALSE to allow it.
A property sheet page can use this notification message to ask the user to verify the cancel operation.