RemoteTextConnection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示远程桌面客户端应用程序与本地计算机的文本输入系统之间的连接。 此连接可用于启用文本输入虚拟化。
public ref class RemoteTextConnection sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.System.RemoteDesktop.Input.IRemoteTextConnectionFactory, 851968, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 851968)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class RemoteTextConnection final : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.System.RemoteDesktop.Input.IRemoteTextConnectionFactory, 851968, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 851968)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.System.RemoteDesktop.Input.IRemoteTextConnectionFactory2, 1048576, "Windows.Foundation.UniversalApiContract")]
class RemoteTextConnection final : IClosable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.System.RemoteDesktop.Input.IRemoteTextConnectionFactory), 851968, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 851968)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class RemoteTextConnection : System.IDisposable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.System.RemoteDesktop.Input.IRemoteTextConnectionFactory), 851968, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 851968)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.System.RemoteDesktop.Input.IRemoteTextConnectionFactory2), 1048576, "Windows.Foundation.UniversalApiContract")]
public sealed class RemoteTextConnection : System.IDisposable
function RemoteTextConnection(connectionId, pduForwarder)
function RemoteTextConnection(connectionId, pduForwarder, options)
Public NotInheritable Class RemoteTextConnection
Implements IDisposable
- 继承
- 属性
- 实现
Windows 要求
| 设备系列 |
Windows 11 (在 10.0.22000.0 中引入)
|
| API contract |
Windows.Foundation.UniversalApiContract (在 v14.0 中引入)
|
注解
RemoteTextConnection 旨在通过与本地桌面集成的远程应用程序启用文本输入虚拟化。 此方案称为 远程程序 或 远程应用程序集成本地(RAIL)。 目前不建议使用具有完整桌面远程处理 RemoteTextConnection,并可能导致不良行为。 启用文本输入虚拟化后,Windows 提供的内置输入法(包括 IME)可用于在远程应用程序中输入文本。
若要启用文本输入虚拟化,远程桌面客户端应用程序将为连接到的每个远程会话创建一个 RemoteTextConnection 对象。 通过此对象向本地计算机的文本输入系统传递数据包,方式如下:
文本输入系统通过 RemoteTextConnectionDataHandler 委托将数据包发送到远程桌面客户端应用程序。 远程桌面客户端应用程序负责创建此委托并将其传递给 RemoteTextConnection 构造函数。 来自文本输入系统的数据包将符合 RDP 文本输入虚拟化协议。 在此委托上收到的消息将到达后台线程。 当客户端应用程序从委托接收数据包时,应通过单向、客户端到服务器 动态虚拟通道(DVC) 将数据包转发到远程 RAIL 服务器,以便进行虚拟化文本输入。 此 DVC 命名为
TextInput_ClientToServerDVC。远程桌面客户端应用程序还需要侦听来自服务器到客户端文本输入 DVC(命名
TextInput_ServerToClientDVC)上的远程计算机上的数据包,并通过 ReportDataReceived 方法将这些数据包转发到本地计算机的文本输入系统。 有关远程桌面客户端应用程序如何支持 DVC 的详细信息,请参阅 动态虚拟通道 (DVC) 和 tsvirtualchannels.h 头文件。
RemoteTextConnection 与远程应用程序集成的唯一本地输入方法是 Windows 提供的内置输入方法,这些输入方法使用下一版 Text Services Framework(包括 IME)。 这些输入法由文本输入系统托管在集中进程中,使集成可行。 较旧的文本服务框架版本 1 或 IMM IME 不会托管在集中式进程中,并且不受文本输入虚拟化的支持。 这些较旧的输入方法必须直接安装在远程系统上,才能使用从该系统远程运行的应用程序。 这与不使用文本输入虚拟化时使用文本服务框架版本 1 和 IMM 输入方法的方式相同。
构造函数
| RemoteTextConnection(Guid, RemoteTextConnectionDataHandler, RemoteTextConnectionOptions) |
表示远程桌面客户端应用程序与本地计算机的文本输入系统之间的连接。 此连接可用于启用文本输入虚拟化。 |
| RemoteTextConnection(Guid, RemoteTextConnectionDataHandler) |
创建特定于一个远程会话的 RemoteTextConnection 类的新实例。 |
属性
| IsEnabled |
指定是否为此 RemoteTextConnection 实例服务的远程桌面连接启用文本输入虚拟化。 |
方法
| Close() |
关闭 RemoteTextConnection 对象。 |
| Dispose() |
执行与释放、释放或重置非托管资源关联的应用程序定义任务。 |
| RegisterThread(UInt32) |
注册远程桌面客户端应用程序将在其中显示远程 UI 的线程。 |
| ReportDataReceived(Byte[]) |
将通过 |
| ReportPredictedKeyEvent(UInt16, RemoteKeyEventAttributes) |
表示远程桌面客户端应用程序与本地计算机的文本输入系统之间的连接。 此连接可用于启用文本输入虚拟化。 |
| UnregisterThread(UInt32) |
在清理时或该线程不再托管远程 UI 时,取消注册通过 RegisterThread 注册的线程。 |