APICustomWindowHandlerProc

User supplied callback function for handling events in windows opened by the add-on.

    typedef GSErrCode  APICustomWindowHandlerProc (
        const API_Guid&                       userRefId,
        API_NotifyWindowEventID     notifID
    );

 

Parameters

userRefId Chnaged in API 22
[in] The reference GUID of the custom window, as supplied to APIDb_NewWindowID.
notifID
[in] The type of the event for the custom window.

 

Return Values

NoError
The function has completed with success.

For other common API errors see the API Errors document.

 

Remarks

This function will be called when installed with APIDb_NewWindowID.

The following types of events will come for your custom window:

Event type Description
APINotifyWindow_Rebuild The user chose Rebuild from the menu.
APINotifyWindow_Activate Your window was activated.
APINotifyWindow_Close The user closed your window.

 

Example


// ============================================================================
// Handling Custom Window Notifications
// ============================================================================
static GSErrCode __ACENV_CALL    CustomWindowHandler (const API_Guid& userRefId, API_NotifyWindowEventID notifID)

{
    char    msgStr[256];

    switch (notifID) {
        case APINotifyWindow_Activate:  Do_ActivateMyWindow (userRefId);
                                        sprintf (msgStr, "APINotifyWindow_Activate %d", userRefId);
                                        break;
        case APINotifyWindow_Rebuild:   Do_RebuildMyWindow (userRefId);
                                        sprintf (msgStr, "APINotifyWindow_Rebuild %d", userRefId);
                                        break;
        case APINotifyWindow_Close:     Do_CloseMyWindow (userRefId, false);
                                        sprintf (msgStr, "APINotifyWindow_Close %d", userRefId);
                                        break;
    }

    ACAPI_WriteReport (msgStr, false);

    DisableEnableCloseCmd ();

    return NoError;
}   // CustomWindowHandler

 

Requirements

Version: API 4.1 or later
Header: APIdefs_Callback.h

 

See Also

API Functions