A property sheet can have only one active page at a time. The active sheet is at the top of the overlapping stack of pages. The user activates a page by selecting its tab; an application uses the PSM_SETCURSEL message to activate a page. Before the page that will become the active page is visible, the property sheet sends it the PSN_SETACTIVE notification message. The page should respond by initializing its control windows.
The property sheet determines whether to enable or disable the Help button for an active page by checking for the PSP_HASHELP style. If the page has this style, it supports the Help button. If the PSP_HASHELP style is not present, it disables the button. When the user clicks the Help button, the active page receives the PSN_HELP notification message. The page should respond by displaying help information.
When the user clicks the OK button, the property sheet sends the PSN_KILLACTIVE notification message to the active page, giving it an opportunity to validate the user's changes. If the page determines that the changes are valid, it should call the SetWindowLong function to set the DWL_MSGRESULT value for the page to FALSE. In this case, the property sheet sends the PSN_APPLY notification message to each page, directing it to apply the new properties to the corresponding item. If the page determines that the user's changes are not valid, it should set DWL_MSGRESULT to TRUE and display a dialog box informing the user of the problem. The page remains active until it sets DWL_MSGRESULT to FALSE in response to a PSN_KILLACTIVE message.
The property sheet sends the PSN_RESET notification message to all pages when the user clicks the Cancel button, indicating that it is about to destroy the property sheet. A page should use the notification to perform cleanup operations.
Note To set the position of a property sheet window in an application, use the SetWindowPos function rather than the MoveWindow function. Call SetWindowPos in the dialog box procedure of the property page that will open first when the user activates a property sheet.