IMsRdpClient::RequestClose method

Requests a graceful shutdown of the Remote Desktop ActiveX control. A graceful shutdown can include ending the user's Remote Desktop Services session but it does not shut down the Remote Desktop Session Host (RD Session Host) server.

Syntax

HRESULT RequestClose(
  [out] ControlCloseStatus *pCloseStatus
);

Parameters

pCloseStatus [out]

Value from the ControlCloseStatus enumeration that indicates whether the application can close the control immediately. Following is a list of possible values.

controlCloseCanProceed (0x0000)

The container application can proceed to close the control immediately. This value can also indicate that the connection has already terminated.

controlCloseWaitForEvents (0x0001)

The container application should not close the control immediately; the application should wait for one of the events described in the following Remarks section to occur before closing.

Return value

Return S_OK if successful.

Remarks

If the pCloseStatus parameter is equal to controlCloseWaitForEvents, the application should wait for one of the following events to occur before the application closes the control:

  • IMsTscAxEvents::OnDisconnected. If the user is not logged on to the Remote Desktop Services session, the application can call the DestroyWindow function to destroy all windows and then close the control.
  • IMsTscAxEvents::OnConfirmClose. If the user is logged on to the Remote Desktop Services session, the control fires an OnConfirmClose event. This event allows the application to prompt the user about whether to close the connection. If the user replies yes to the prompt, the container application can call DestroyWindow to destroy all windows, and close the control.

RequestClose allows a container application to prompt the user about whether to close a connection. For more information, see IMsTscAxEvents::OnConfirmClose.

For more information about Remote Desktop Web Connection, see Requirements for Remote Desktop Web Connection.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Type library
MsTscAx.dll
DLL
MsTscAx.dll
IID
IID_IMsRdpClient is defined as 92b4a539-7115-4b7c-a5a9-e5d9efc2780a

See also

IMsRdpClient

IMsRdpClient2

IMsRdpClient3

IMsRdpClient4

IMsRdpClient5

IMsRdpClient6

IMsRdpClient7

IMsRdpClient8

IMsRdpClient9

IMsRdpClient10

IMsTscAxEvents::OnConfirmClose

IMsTscAxEvents::OnDisconnected