Поделиться через


IMsRdpClient::RequestClose (Windows Embedded CE 6.0)

1/6/2010

This method is called by the container application to request a graceful shutdown of the Remote Desktop ActiveX control. A graceful shutdown can include ending the user's Terminal Services session, but it does not shut down the Terminal server.

Syntax

HRESULT RequestClose(
  ControlCloseStatus* pCloseStatus
);

Parameters

  • pCloseStatus
    [out] Pointer to a value that indicates whether or not the application can close the control immediately. The following table shows possible values for this parameter.

    Value Description

    ControlCloseCanProceed

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

    ControlCloseWaitForEvents

    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

If the method succeeds, the return value is S_OK.

If it fails, the method returns a nonzero error code.

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 Terminal Services session, the application can call the DestroyWindow function to destroy all windows and close the control.
  • IMsTscAxEvents::OnConfirmClose If the user is logged on to the Terminal Services session, the control triggers an OnConfirmClose event. This event allows the application to prompt the user to close the connection. If the user chooses to close the connection, the container application can call DestroyWindow to destroy all windows and close the control.

The RequestClose method allows a container application to prompt the user to close a connection. This is similar to the behavior of the User Interface (UI) of the Windows 2000 Terminal Services client. For more information, see the IMsTscAxEvents::OnConfirmClose method.

Requirements

Header discodlg.h, mstsax.idl
Library Mstsax.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

IMsRdpClient
IMsTscAxEvents::OnConfirmClose