Export (0) Print
Expand All

IRealTimeStylus::GetStylusForId method

Applies to: desktop apps only

Retrieves a stylus for the specified stylus identifier.

Syntax

HRESULT GetStylusForId(
  [in]           STYLUS_ID sid,
  [out, retval]  IInkCursor **ppiInkCursor
);

Parameters

sid [in]

Specifies security identifier (SID) for the collection.

ppiInkCursor [out, retval]

When this method returns, contains a pointer to an IInkCursor that describes the stylus for the sid parameter.

Return value

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

Examples

The following C++ example code gets an array of the Stylus objects that the RealTimeStylus Class object has encountered since it was last enabled. It then iterates through the array reporting the ID of each stylus in debug output.


IInkCursors *piInkCursors;

if (SUCCEEDED(g_pRealTimeStylus->GetStyluses(&piInkCursors)))
{
    long lCursorCount;
    
    if (SUCCEEDED(piInkCursors->get_Count(&lCursorCount)))
    {
        for (long l = 0; l < lCursorCount; l++)
        {
            LONG sid;
            IInkCursor *piInkCursor;
            IInkCursor *piInkCursorForId;

            piInkCursors->Item(l, &piInkCursor);
            piInkCursor->get_Id(&sid);

            if (SUCCEEDED(g_pRealTimeStylus->GetStylusForId((STYLUS_ID)sid, &piInkCursorForId)))
            {
                TRACE("Got stylus with ID %d\n", sid);
            }
        }
    }
}


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::GetStyluses Method

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2014 Microsoft