Starts inking feedback while pen input is being collected.
int StartInking( HPCM hpcm, UINT idEvent, LPINKINGINFO lpinkinginfo )
Handle to the current collection. This is the return value from StartPenInput
The identifier of the packet at which to start inking.
Address of an INKINGINFO
structure, used to specify the characteristics of the ink. This parameter can
be NULL to use the default ink characteristics. Otherwise, the structure's cbSize
member must be initialized with sizeof( INKINGINFO ).
Returns PCMR_OK if inking started successfully; otherwise, returns one of the
||There is no display device, or it was unable to ink at this time, or there was
an error in setting the pen-tip characteristics.
||The INKINGINFO structure contains invalid values, or there was some other unspecified error.
||The hpcm handle is invalid because the calling application did not start input by
||The idEvent parameter is invalid.
An application calls StartInking
to track pen movement while the pen tip is down. When pen input is started by
calling the StartPenInput
function, Windows initializes the internal INKINGINFO
structure as follows:
- The wFlags member is set to PII_INKPENTIP | PII_INKCLIPRECT.
- The tip member is set to the system default pen tip, as obtained by calling the GetPenMiscInfo function.
- The rectClip member is set to the client area, in screen coordinates, of the window that
was used in the call to the StartPenInput function.
The first call to StartInking
with the lpinkinginfo
parameter set to NULL starts inking with the settings listed above. If the
calling application uses a non-NULL value for lpinkinginfo
, the appropriate internal inking parameters are modified before inking
starts, depending on the flags set in the wFlags
member of the INKINGINFO
is called, the current settings of the internal inking structure are added to
or replaced. Specific values must be set in the members of INKINGINFO
to disable them. Refer to the description of each member in the INKINGINFO
structure for these values.
If a region is passed in for clipping or stopping the ink, the application
must destroy the region. Since a copy is made, the region can be destroyed
immediately following the call to StartInking
. The application can specify either a clip region or a clip rectangle.
Specifying both will result in the clip rectangle being ignored.
The following code example changes the inking tip from the default (as set by
a call to StartPenInput
) to red ink, 5 pixels wide. It also adds an inkstop
rectangle (inking stops if the pen touches down inside the inkstop
rectangle). The clipping rectangle remains unchanged from the default settings.
inkinginfo.cbSize = sizeof( INKINGINFO );
inkinginfo.wFlags = PII_INKPENTIP | PII_INKSTOPRECT;
inkinginfo.tip.cbSize = sizeof( PENTIP );
inkinginfo.tip.rgb = RGB( 255,0,0 );
inkinginfo.tip.bwidth = 5;
inkinginfo.rectInkStop.left = rectInkTop.top = 0;
inkinginfo.rectInkStop.right = rectInkTop.bottom = 100;
ClientToScreen( hwnd, (LPPOINT)&(inkinginfo.rectInkStop) );
ClientToScreen( hwnd, (LPPOINT)&(inkinginfo.rectInkStop.right) );
StartInking( hpcm, wEventRef, &inkinginfo );
- Software for developers
Software for Android Developers
- More information resources
Unix Manual Pages