IRealTimeStylus::SetDesiredPacketDescription 方法 (rtscom.h)

请求要包含在数据包流中的属性。

语法

HRESULT SetDesiredPacketDescription(
  [in] ULONG      cProperties,
  [in] const GUID *pPropertyGuids
);

parameters

[in] cProperties

pPropertyGuids 参数指定的属性计数。 有效值介于 0 和 32 之间(包括 0 到 32)。

[in] pPropertyGuids

请求包含在数据包流中的属性) 全局唯一标识符 (GUID 数组。

返回值

如果该方法成功,则返回 S_OK。 否则,将返回 HRESULT 错误代码。

注解

事件按以下顺序接收实际的数据包属性。

数据包顺序 说明
第 1 个位置 包含属性的 x 坐标数据,而不考虑是否在 DesiredPacketDescription 属性中指定了 X。
第 2 个位置 包含属性的 y 坐标数据,无论 Y 是否在 DesiredPacketDescription 属性中指定。
结束位置 包含数据包状态在 DesiredPacketDescription 属性中时的数据包状态。
 
注意IRealTimeStylus::GetPacketDescriptionData 方法的结果可能与 IRealTimeStylus::SetDesiredPacketDescription 方法属性不匹配,因为平板电脑可能不支持某些属性。
 
如果平板电脑设备不支持指定的数据包属性,则不会返回属性数据,并且不会在数据包数据数组中表示。 如果同一 GUID 多次出现在 packetDescription 参数中,则仅保留第一个外观,并筛选掉以下所有外观。只有在禁用 RealTimeStylus 类对象时,才能调用 IRealTimeStylus::SetDesiredPacketDescription 方法方法。

尝试为 cProperties 传入 0,为 pPropertyGuids 传入 NULL 将返回E_INVALIDARG。

IRealTimeStylus::SetDesiredPacketDescription 方法 方法方法的调用会立即反映在 IRealTimeStylus::GetDesiredPacketDescription 方法 方法的返回值中。

示例

以下 C++ 示例代码设置请求包含在数据包流中的属性。

GUID guidDesiredPacketDescription[] = { GUID_PACKETPROPERTY_GUID_X, 
                                        GUID_PACKETPROPERTY_GUID_Y, 
                                        GUID_PACKETPROPERTY_GUID_NORMAL_PRESSURE,
                                        GUID_PACKETPROPERTY_GUID_TANGENT_PRESSURE };

// Number of properties in the array
ULONG ulProperties = sizeof(guidDesiredPacketDescription) / sizeof(GUID);

// Set the packet information we'd like to get
if (SUCCEEDED(g_pRealTimeStylus->SetDesiredPacketDescription(ulProperties, guidDesiredPacketDescription)))
{
    TRACE("Set the desired packet description successfully.\n");
}

GUID* pGuids = NULL;

// See if setting the properties was successful
if (SUCCEEDED(g_pRealTimeStylus->GetDesiredPacketDescription(&ulProperties, &pGuids)))
{
    TRACE("The RealTimeStylus supports %d properties.\n", ulProperties);

    // Display the values of the GUIDs in debug output
    for (int i = 0; i < ulProperties; i++)
    {
        TRACE("GUID #%d == %d\n", i, pGuids[i]);
    }
}

要求

   
最低受支持的客户端 Windows XP Tablet PC Edition [仅限桌面应用]
最低受支持的服务器 无受支持的版本
目标平台 Windows
标头 rtscom.h
DLL RTSCom.dll

请参阅

IRealTimeStylus

IRealTimeStylus::GetDesiredPacketDescription 方法

IRealTimeStylus::GetPacketDescriptionData 方法

RealTimeStylus 类