Returns the identifier of the current (active) window.
GSErrCode ACAPI_Database ( APIDb_GetCurrentWindowID, API_WindowInfo* windowInfo );
Parameters
- windowInfo
- [out] The identification parameters of the front window
Return Values
NoError
- The function has completed with success.
APIERR_BADPARS
windowInfo
isnullptr
.APIERR_BADWINDOW
- the type of the current front window is not known by the API
For other common API errors see the API Errors document.
Remarks
This function is used to return the parameters of the front window of the server application. It can be used to identify which window your command was called on.
Generally the current window and the window of the current database are the same. However you must be careful; the database dependent functions work on the current database not on the database of the current window. The interface functions work on the current window always.
Note that this function fills out only the fields which are needed to identify the window type and the database behind the window. In order to retrieve the additional parameters of the database (title
, name
, ref
, masterLayoutUnId
) call the APIDb_GetDatabaseInfoID function with the databaseUnId
of the current window.
Use the APIDo_ChangeWindowID function to change the current window.
Example
API_WindowInfo windowInfo; BNZeroMemory (&windowInfo, sizeof (API_WindowInfo)); GSErrCode err = ACAPI_Database (APIDb_GetCurrentWindowID, &windowInfo, nullptr);
Requirements
- Version: API 4.1 or later
- Header: APIdefs_Database.h
See Also
API_WindowInfo
APIDb_GetCurrentDatabaseID, APIDb_GetDatabaseInfoID
APIDo_ChangeWindowID
ACAPI_Database, API Functions