LONG CommonPropertySheetUI(
HWND hWndOwner, | |
PFNPROPSHEETUI pfnPropSheetUI, | |
LPARAM lParam, | |
LPDWORD pResult | |
); |
CommonPropertySheetUI manages and displays a property sheet.
CommonPropertySheetUI returns one of the following values:
Return Value |
Description |
CPSUI_CANCEL |
The property sheet was not displayed because there were no pages. |
CPSUI_OK |
The function succeeded. |
CPSUI_RESTARTWINDOWS |
The function succeeded. The property sheet was displayed, and the end-user changed a selection that requires the login session to be restarted in order for the change to take effect. |
CPSUI_REBOOTSYSTEM |
The function succeeded. The property sheet was displayed, and the end-user changed a selection that requires the system to be rebooted in order for the change to take effect. |
ERR_CPSUI_Xxx |
The property sheet was not displayed due to the error specified by the return error code. These error code values are always less than zero. |
CommonPropertySheetUI is the main entry point for the CPSUI. An application calls this function to have the CPSUI manage and display a property sheet.
The function to which pfnPropSheetUI points is a caller-defined function in which the caller requests the CPSUI to add pages to the property sheet. The CPSUI calls this function as follows:
PROPSHEETUI_INFO PSUIInfo; pfnPropSheetUI(&PSUIInfo, lParam);
When an end-user closes the property sheet by selecting OK or Cancel, CommonPropertySheetUI returns the appropriate CPSUI_Xxx value to the original caller.
If the function to which pfnPropSheetUI points returns a LONG value greater than zero, the CPSUI displays the property sheet dialog boxes. When an end-user closes the property sheet by selecting OK or Cancel, CommonPropertySheetUI returns one of CPSUI_OK, CPSUI_RESTARTWINDOWS, or CPSUI_REBOOTSYSTEM. If the callback returns a LONG value that is equal to or less than zero, there were no pages on the property sheet or an error was encountered. In this situation, the CPSUI did not display the property sheet and CommonPropertySheetUI returns CPSUI_CANCEL or ERR_CPSUI_Xxx.
When the last call to pfnPropSheetUI() returns, the value in the Result field of PROPSHEETUI_INFO is copied into the DWORD to which pResult points. The pResult parameter is set only when CommonPropertySheetUI does not return ERR_CPSUI_Xxx. CommonPropertySheetUI does not return the last DWORD result of pfnPropSheet() if pResult is null.