APIDb_​CloseWindowID

Closes a window.

    GSErrCode ACAPI_Database (
        APIDb_CloseWindowID,
        API_WindowInfo*     windowInfo
    );

 

Parameters

windowInfo
parameters of the window to be closed (type and reference index)

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
windowPars is nullptr.
APIERR_REFUSEDCMD
the function is called from notification level.
APIERR_REFUSEDPAR
not APIWind_MyTextID or APIWind_MyDrawID is requested.
APIERR_WINDNOTEXIST
a window with the same type and reference index is not opened.
APIERR_NOPLAN
no open project

For other common API errors see the API Errors document.

 

Remarks

This function is used to close a previously opened custom window.

It is the inverse function of APIDb_NewWindowID, so it is limited to close simple text or drawing windows. Such a window can be closed from the same addon, which it was opened from.

 

Example


API_WindowInfo      windowInfo;
GSErrCode           err;

BNZeroMemory (&windowInfo, sizeof (API_WindowInfo));
windowInfo.typeID = APIWind_MyDrawID;
windowInfo.index  = 1;

err = ACAPI_Database (APIDb_CloseWindowID, &windowInfo, nullptr);

 

Requirements

Version: API 4.1 or later
Header: APIdefs_Database.h

 

See Also

API_WindowInfo,
APIDb_NewWindowID,
ACAPI_Database, API Functions