CPSUICBPARAM

typedef struct _CPSUICBPARAM {

WORD cbSize;

WORD Reason;

HWND hDlg;

POPTITEM pOptItem;

WORD cOptItem;

WORD Flags;

POPTITEM pCurItem;

union {

LONG OldSel;

LPTSTR pOldSel;

};

DWORD UserData;

DWORD Result;

} CPSUICBPARAM, *PCPSUICBPARAM;

The CPSUICBPARAM structure contains the reason for the CPSUI's call to _CPSUICALLBACK, and the parameters needed by _CPSUICALLBACK to make changes to an option item and return an action to the CPSUI. The CPSUI can then redisplay the treeview or Page Setup data.

Members

cbSize

Size in bytes of this structure.

Reason

Specifies the reason that the CPSUI is calling back to the caller. This member can be one of the following values.

Reason Description
CPSUICB_REASON_
SEL_CHANGED
The user has made a change to the item to which pCurItem points. If the DMPubID field of the affected OPTITEM is DMPUB_COPIES_COLLATE, the CPSUI enables/disables the extended check box without calling back to _CPSUICALLBACK.
CPSUICB_REASON_
PUSH BUTTON
The user has pushed the push button, and the push button item's OPTPARAM Style field is set to PUSH BUTTON_TYPE_CALLBACK.
CPSUICB_REASON_
ECB_CHANGED
The user has changed state in the extended check box described by the structure to which pCurItem->pExtChkBox points.
CPSUICB_REASON_
DLGPROC
The user has pushed the push button, and the push button item's OPTPARAM Style field is set to PUSH BUTTON_TYPE_DLGPROC.
CPSUICB_REASON_
EXTPUSH
The user has pushed the extended push button described by the structure to which pCurItem->pExtPush points.
CPSUICB_REASON_
APPLYNOW
The user has pushed the Apply Now push button. The CPSUI sets pCurItem to point to the item to which pOptItem points. It also sets OldSel to -1 to indicate that all valid changed items should be applied now.
CPSUICB_REASON_
OPTITEM_SETFOCUS
An option item has keyboard focus. The CPSUI calls the callback so that it can examine the item.
CPSUICB_REASON_
ITEMS_REVERTED
After changing option(s), the user has pushed the Undo push button to undo the changes.
CPSUICB_REASON_
ABOUT
The user has pushed the About Xxx push button on the treeview page, and the CPSUIF_ABOUT_CALLBACK flag is set, indicating that the caller has hooked the About page to display their proprietary About information. _CPSUICALLBACK sets pCurItem to point to the item to which pOptItem points, and sets pOldSel to point to the original copy of the COMPROPSHEETUI structure passed to the CPSUI.

hDlg

Handle to the dialog box that is currently active for the _CPSUICALLBACK function.

pOptItem

Points to an array of OPTITEM structures that describe the treeview items to be displayed by the CPSUI. This is the same pointer sent by the caller to the CPSUI's pfnComPropSheet callback in the pOptItem field of the COMPROPSHEETUI structure.

cOptItem

Number of OPTITEM structures to which pOptItem points. This is the same value sent by the caller to the CPSUI's pfnComPropSheet callback in the cOptItem field of the COMPROPSHEETUI structure.

Flags

Specifies the flags passed by the caller to the CPSUI's pfnComPropSheet callback in the Flags field of the COMPROPSHEETUI structure.

pCurItem

Pointer to the OPTITEM structure in the array to which pOptItem points that describes the item for which the callback was generated.

OldSel

The Sel field of the OPTITEM structure that was current before the user made a change. This field is valid only when the Reason callback is CPSUICB_REASON_SEL_CHANGED. The callback can use this field to check the change against the previous item selection.

pOldSel

Pointer to a null-terminated string that describes the option item's last selection before a change was made by the user; that is, pOldSel is equal to the previously current OPTITEM's pSel field. The pOldSel member is valid only when the Reason callback is CPSUICB_REASON_SEL_CHANGED. The callback can use this field to check the change against the previous item selection.

UserData

Specifies the 32-bit value provided by the original caller to the CPSUI's pfnComPropSheet callback in the UserData field of the COMPROPSHEETUI structure.

Result

Specifies the result of the _CPSUICALLBACK callback. The default Result is CPSUI_OK, and is set by the CPSUI. The _CPSUICALLBACK function can alter this result before returning to the CPSUI. The Result field need only be set when Reason is CPSUICB_REASON_APPLYNOW; the CPSUI ignores Result for all other reasons.

Comments

When Reason is CPSUICB_REASON_APPLYNOW, _CPSUICALLBACK must set the requested result in the Result field when it returns a value other than CPSUICB_ACTION_NO_APPLY_EXIT. The CPSUI sends Result to the parent of the current property sheet page.