Export (0) Print
Expand All

IRealTimeStylus::GetTabletContextIdFromTablet method

Applies to: desktop apps only

Retrieves the TabletContextId property that is associated with a given tablet digitizer object.

Syntax

HRESULT GetTabletContextIdFromTablet(
  [in]           IInkTablet *piTablet,
  [out, retval]  TABLET_CONTEXT_ID *ptcid
);

Parameters

piTablet [in]

Specifies the tablet object associated with a digitizer for which to get the unique identifier for the tablet context.

ptcid [out, retval]

The unique identifier for the tablet context.

Return value

For a description of the return values, see RealTimeStylus Classes and Interfaces.

Remarks

A digitizer context identifier is specific to an RealTimeStylus Class object. Two RealTimeStylus Class objects may have different context identifiers for the same digitizer object. A tablet context identifier is valid only while a RealTimeStylus Class object is enabled. If a RealTimeStylus Class object is disabled and then re-enabled, the TCID for each digitizer object might have a different value than it had when the RealTimeStylus Class object was first enabled.

This method can be called even if the RealTimeStylus Class object is not enabled as long as the RealTimeStylus Class has not finished processing data in the queue. This method can be called until the last asynchronous plug-in receives IStylusPlugin::RealTimeStylusDisabled Method.

Examples

The following C++ example code gets a pointer to the IInkTablet object and uses that to get the tablet context identifier. Then it displays the names of all the tablets attached to the system in the debug output window.


TABLET_CONTEXT_ID* pTcids = NULL;
TABLET_CONTEXT_ID tcid = 0;
ULONG ulTcidCount = 0;
IInkTablet* pInkTablet = NULL;

if (SUCCEEDED(g_pRealTimeStylus->GetAllTabletContextIds(&ulTcidCount, &pTcids)))
{
    TRACE("Got the tablet context ID array.\n");

    // Loop through all the tablets on the system
    for (ULONG i = 0; i < ulTcidCount; i++)
    {
        // Get the tablet from the context ID
        if (SUCCEEDED(g_pRealTimeStylus->GetTabletFromTabletContextId(pTcids[i], &pInkTablet)))
        {
            // Display the name of the tablet in debug output
            BSTR bstrName;
            if (SUCCEEDED(pInkTablet->get_Name(&bstrName)))
            {
                TRACE("The name of tablet %d is %s.\n", i, bstrName);
            }
        }
    }

    // Get the context ID from the tablet
    if (SUCCEEDED(g_pRealTimeStylus->GetTabletContextIdFromTablet(pInkTablet, &tcid)))
    {
        TRACE("The context ID of the tablet is %d\n", tcid);
    }
}


Requirements

Minimum supported client

Windows XP Tablet PC Edition

Minimum supported server

None supported

Header

RTSCom.h (also requires RTSCom_i.c)

DLL

RTSCom.dll

See also

IRealTimeStylus
RealTimeStylus Class
IRealTimeStylus::GetTabletFromTabletContextId Method

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2015 Microsoft