IRealTimeStylus::GetStyluses method (rtscom.h)

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

Syntax

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

Parameters

[out, retval] ppiInkCursors

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.

Remarks

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.
 

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

Requirement Value
Minimum supported client Windows XP Tablet PC Edition [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header rtscom.h
DLL RTSCom.dll

See also

IRealTimeStylus

IRealTimeStylus::GetStylusForId Method

RealTimeStylus Class