PSN_QUERYCANCEL notification code

Indicates that the user has canceled the property sheet. This notification code is sent in the form of a WM_NOTIFY message.


    lppsn = (LPPSHNOTIFY) lParam;  



Pointer to a PSHNOTIFY structure that contains information about the notification code. This structure contains an NMHDR structure as its first member, hdr. The hwndFrom member of this NMHDR structure contains the handle to the property sheet. The lParam member of the PSHNOTIFY structure does not contain any information.

Return value

Returns TRUE to prevent the cancel operation, or FALSE to allow it.


This notification code is typically sent when a user clicks the Cancel button. It is also sent when a user clicks the X button in the property sheet's upper right hand corner or presses the ESCAPE key. A property sheet page can handle this notification code to ask the user to verify the cancel operation.

To set a return value, the dialog box procedure for the page must call the SetWindowLong function with DWL_MSGRESULT set to the return value. The dialog box procedure must return TRUE.


Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]