PENINFO 

1.0    2.0     

Contains dimensions, sampling rate, and other information about the pen or tablet hardware.

typedef struct { 

     UINT cxRawWidth;

     UINT cyRawHeight;

     UINT wDistinctWidth;

     UINT wDistinctHeight;

     int nSamplingRate;

     int nSamplingDist;

     LONG lPdc;

     int cPens;

     int cbOemData;

     OEMPENINFO rgoempeninfo[MAXOEMDATAWORDS];

     UINT rgwReserved[7];

     UINT fuOEM;

} PENINFO;

Members

cxRawWidth

Width of tablet in thousandths of an inch. Also specifies the maximum tablet x-coordinate.

cyRawHeight

Height of tablet in thousandths of an inch. Also specifies the maximum tablet y-coordinate.

wDistinctWidth

Number of distinct x-coordinates the hardware can detect.

wDistinctHeight

Number of distinct y-coordinates the hardware can detect. Together, the wDistinctWidth and wDistinctHeight members express the x-y resolution of the tablet. For example, if a tablet is 8 inches wide and has a resolution of 1/500 of an inch, cxRawWidth is 8000 and wDistinctWidth is 4000 because the tablet hardware can return 4000 distinct x-order values ranging from 0 to 8000.

nSamplingRate

Specifies the number of samples per second the tablet can return. This value may be less than the number of hardware interrupts per second the tablet generates because several interrupts may be required to create one pen packet sample. See the  Comments  section below for information on adjusting the sampling rate.

nSamplingDist

Specifies the distance in distinct tablet units a pen must travel before a new pen event is generated. See the  Comments  section below for information on adjusting the sampling distance.

lPdc

Pen-device capabilities, expressed as a bitwise-OR combination of the PDC_ flags.

cPens

Number of pens the tablet can simultaneously support.

cbOemData

Specifies the width, in bytes, of the additional OEM data passed in each pen packet. For example, if a tablet can detect pressure and Z-angle information, this information occupies two additional words of OEM data, so cbOemData is 4.

rgoempeninfo[MAXOEMDATAWORDS]

An array of OEMPENINFO1AOCX6 structures. Each structure describes one word of additional OEM data contained in each pen packet. (MAXOEMDATAWORDS is defined as 6.)

rgwReserved[7]

Reserved for internal use.

fuOEM

Flags representing which OEM data to report in rgoempeninfo; used by applications to determine the OEM data used in an HPENDATA object. This member is set and used internally by the pen services and should never be modified by an application. This member is a bitwise-OR combination of the following values:

Constant

Description

PHW_ALL

Report all available OEM data.

PHW_PRESSURE

Report pressure if available.

PHW_HEIGHT

Report height if available.

PHW_ANGLEXY

Report Xy-angle if available.

PHW_ANGLEZ

Report Z-angle if available.

PHW_BARRELROTATION

Report barrel rotation if available.

PHW_OEMSPECIFIC

Report OEM-specific value if available.

PHW_PDK

Report per-point PDK_ values.

 

 

Comments

The DRV_GetPenInfo pen driver message fills a PENINFO structure with the current device parameters. DRV_GetPenInfo returns FALSE if a tablet is not present. If this occurs, the PENINFO structure that the message s lParam1 points to is not valid. Note that an application should retrieve tablet information with the GetPenDataInfo232HAHC and GetPenDataAttributes1AOBX_ functions, rather than accessing the pen driver directly.

An application can also adjust the tablet sampling rate and sampling distance by sending the DRV_SetSamplingRate or DRV_SetSamplingDist messages to the device driver. For more information, see Appendix E,  Accessing the Pen Device Driver. 

For a list of state bits for the pen driver, refer to the entry for PDK_ values in Chapter 13,  Pen Application Programming Interface Constants. 

See Also

CreatePenDataEx, TrimPenData, UpdatePenInfo, OEMPENINFO