PropSheetProc callback function

An application-defined callback function that the system calls when the property sheet is being created and initialized.

Syntax


int CALLBACK PropSheetProc(
   HWND   hwndDlg,
   UINT   uMsg,
   LPARAM lParam
);

Parameters

hwndDlg

Type: HWND

Handle to the property sheet dialog box.

uMsg

Type: UINT

Message being received. This parameter is one of the following values.

ValueMeaning
PSCB_BUTTONPRESSED

Version 6.0 and later. Indicates the user pressed a button in the property sheet dialog box. To enable this, specify PSH_USECALLBACK in PROPSHEETHEADER.dwFlags and specify the name of this callback function in PROPSHEETHEADER.pfnCallback. The lParam value is one of the following. Note that only PSBTN_CANCEL is valid when you are using the Aero wizard style (PSH_AEROWIZARD).

Button pressedlParam value
OKPSBTN_OK
CancelPSBTN_CANCEL
ApplyPSBTN_APPLYNOW
ClosePSBTN_FINISH

 

Note that Comctl32.dll versions 6 and later are not redistributable. To use these versions of Comctl32.dll, specify the particular version in a manifest. For more information on manifests, see Enabling Visual Styles.

PSCB_INITIALIZED

Indicates that the property sheet is being initialized. The lParam value is zero for this message.

PSCB_PRECREATE

Indicates that the property sheet is about to be created. The hwndDlg parameter is NULL, and the lParam parameter is the address of a dialog template in memory. This template is in the form of a DLGTEMPLATE or DLGTEMPLATEEX structure followed by one or more DLGITEMTEMPLATE structures. This message is not applicable if you are using the Aero wizard style (PSH_AEROWIZARD).

 

lParam

Type: LPARAM

Additional information about the message. The meaning of this value depends on the uMsg parameter.

If uMsg is PSCB_INITIALIZED or PSCB_BUTTONPRESSED, the value of lParam is zero.

If uMsg is PSCB_PRECREATE, then lParam will be a pointer to either a DLGTEMPLATE or DLGTEMPLATEEX structure describing the property sheet dialog box. Test the signature of the structure to determine the type. If signature is equal to 0xFFFF then the structure is an extended dialog template, otherwise the structure is a standard dialog template.



   if (uMsg == PSCB_PRECREATE) 
   {
        if (lParam)
        {
             DLGTEMPLATE *pDlgTemplate;
             DLGTEMPLATEEX *pDlgTemplateEx;
            
             pDlgTemplateEx = (DLGTEMPLATEEX *)lParam;
             if (pDlgTemplateEx->signature == 0xFFFF)
             {
                    // pDlgTemplateEx points to an extended  
                    // dialog template structure.
             }
             else
             {
                    // This is a standard dialog template
                    //  structure.
                    pDlgTemplate = (DLGTEMPLATE *)lParam;
             }
        }    
   }

Return value

Type: int

Returns zero.

Remarks

To enable a PropSheetProc callback function, use the PROPSHEETHEADER structure when you call the PropertySheet function to create the property sheet. Use the pfnCallback member to specify an address of the callback function, and set the PSP_USECALLBACK flag in the dwFlags member.

PropSheetProc is a placeholder for the application-defined function name. The PFNPROPSHEETCALLBACK type is the address of a PropSheetProc callback function.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Prsht.h

 

 

Show: