The SimConnect_Close function is used to request that the communication with the server is ended.

 

Syntax
HRESULT SimConnect_Close(
    HANDLE  hSimConnect
    );

 

Parameters
ParameterDescriptionType
hSimConnectHandle to a SimConnect object.Integer

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return valueDescription
S_OKThe function succeeded.
E_FAILThe function failed. This should only happen if a the hSimConnect parameter is erroneous.

 

Example
hr = SimConnect_Close(hSimConnect);

 

Remarks

When a SimConnect client is closed, the server will remove all objects, menu items, group definitions and so on, defined or requested by that client, so there is no need to remove them explicitly in the client code.