IRealTimeStylus::GetStyluses method

Retrieves the collection of styluses the RealTimeStylus Class object has encountered.


HRESULT GetStyluses(
  [out, retval] IInkCursors **ppiInkCursors


ppiInkCursors [out, retval]

When this method returns, contains a pointer to the collection of styluses the RealTimeStylus Class object has encountered.

Return value

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


The RealTimeStylus Class collection includes the styluses for which a tablet context has been created. The collection does not include all styluses available in the system in the stylus collection.

If no stylus object has been detected on the tablet objects associated with the RealTimeStylus Class object, this method returns an empty array.

This method cannot be called unless it the RealTimeStylus Class object is connected and enabled RealTimeStylus Class.

Note  This method can be called if IRealTimeStylus::Enabled Property returns false as long as the RealTimeStylus Class object has not finished processing data in the queue. This method can be called until the last asynchronous plug-in receives IStylusPlugin::RealTimeStylusDisabled Method.


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);

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


Minimum supported client

Windows XP Tablet PC Edition [desktop apps only]

Minimum supported server

None supported


RTSCom.h (also requires RTSCom_i.c)



See also

RealTimeStylus Class
IRealTimeStylus::GetStylusForId Method
RealTimeStylus Class