Previous Next

_CPSUICALLBACK

The _CPSUICALLBACK function type is used by CPSUI applications (including printer interface DLLs) for defining a callback function intended for use as a CPSUI message handler.

typedef LONG
  (APIENTRY *_CPSUICALLBACK)(
    PCPSUICBPARAM  pComPropSheetUICBParam
    );

Parameters

pComPropSheetUICBParam
CPSUI-supplied pointer to a CPSUICBPARAM structure.

Return Value

A _CPSUICALLBACK-typed callback function must return one of the values listed in the following table. Each value indicates an action that CPSUI should perform.

Return Value Reason Used Action Performed by CPSUI
CPSUICB_ACTION_ITEMS_APPLIED
  The CPSUICBPARAM structure's Reason member was set to CPSUICB_REASON_APPLYNOW, and the callback function has successfully processed the current option values. CPSUI saves the page's option settings.
CPSUICB_ACTION_NO_APPLY_EXIT
The CPSUICBPARAM structure's Reason member was set to CPSUICB_REASON_APPLYNOW, but the callback function has detected invalid or incompatible option values. The callback function must display a pop-up dialog telling the user of the problem. CPSUI keeps the current page active so the user can modify option values.
CPSUICB_ACTION_NONE
  No action by CPSUI is required. None.
CPSUICB_ACTION_OPTIF_CHANGED
  The callback function has set the OPTIF_CHANGED flag in an OPTITEM structure to indicate that the selected option has changed, or that another OPTIF-prefixed flag has changed. CPSUI redisplays the page.
CPSUICB_ACTION_REINIT_ITEMS
  The callback function has set the OPTIF_CHANGED flag in an OPTITEM structure to indicate that Flags or pData members of the associated OPTTYPE or OPTPARAM structure have changed. CPSUI re-initializes and redisplays the page.

Headers

Declared in compstui.h. Include compstui.h.

Comments

Callback functions specified using the _CPSUICALLBACK function type are supplied by applications that use CPSUI to manage property sheet pages. If one of these callback functions is associated with a property sheet page, CPSUI calls it when user activity (such as changing the page's control focus, modifying option values, or clicking on OK) is detected.

A _CPSUICALLBACK-typed callback function is assigned to a property sheet page by including its address in a COMPROPSHEETUI structure, which is passed to CPSUI's ComPropSheet function when the function code is CPSFUNC_ADD_PCOMPROPSHEETUI.

Additionally, callback functions can be assigned to extended push buttons through the use of EXTPUSH structures.

When one of these callback functions is called, it receives a pointer to a CPSUICBPARAM structure. This structure describes the current option settings for the page and indicates the user event that caused the function to be called. The callback function is responsible for validating and processing the settings. It should display a pop-up dialog if a setting (or a combination of settings) is invalid. The function's return value indicates to CPSUI whether the page needs to be redisplayed or reinitialized.

Callback functions specified with this function type cannot be used if the DlgProc member of the DLGPAGE structure specifies an application-supplied dialog box procedure. This is because _CPSUICALLBACK-typed callbacks are called from CPSUI's dialog box procedures, which are not used if the application supplies its own procedures.