Creates a region that envelops the point data in an HPENDATA object.

HRGN CreatePenDataRegion( HPENDATA hpndt, UINT uType )



Handle to the HPENDATA object.


Type of region to create. This can be one of the following values:


The bounding box of the pen data ink is converted to a region.


The pen data describes a lasso that makes up the boundary of the region. If the last point of the pen data does not coincide with the first point, a closed figure is created either by joining the endpoints with a straight line or by using the intersection point of the beginning and ending line segments, whichever is more appropriate. Only the first stroke is used; if the pen data has more than a single stroke, subsequent strokes are ignored.

Return Value

This function returns a handle to a region if successful; otherwise the return value is NULL.


The coordinates of the region are the same as those used in the pen data. It is the application's responsibility to remove the region when the application is finished with it, using the Windows DeleteObject function.

CreatePenDataRegion enables an application to determine the screen area a gesture such as lasso or cut applies to. For an example of how to use the CreatePenDataRegion function to determine the area of a gesture, see the section "DoDefaultPenInput Messages" in Chapter 2, "Starting Out with System Defaults."

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database