SetPenMiscInfo

  1. 0 2.0

Sets constants pertaining to the pen system.

LONG SetPenMiscInfo( UINT wParam, LPARAM lParam )

Parameters

wParam

Specifies the identifier of the pen system measurement to set. The identifier must be a PMI_ value, and may be combined with PMI_SAVE (to force an immediate initialization file update) using the bitwise-OR operator for some values. See the following table for the possible PMI_ values in wParam.

lParam

Specifies the value of the pen system measurement to set. Depending on the value of wParam (listed in the first column of the table below), lParam can be the address of a structure or a value, as described here:

wParam constant
lParam description
PMI_BEDIT
lParam is the address of a BOXEDITINFO structure.
PMI_ENABLEFLAGS
lParam is a WORD value.
PMI_PENTIP
lParam is the address of a PENTIP structure.
PMI_TIMEOUT
lParam is a UINT value.
PMI_TIMEOUTGEST
lParam is a UINT value.
PMI_TIMEOUTSEL
lParam is a UINT value.

Return Value

Returns PMIR_OK if successful; otherwise, returns one of the following negative error values:

Constant
Description
PMIR_INDEX
wParam is out of range.
PMIR_INIERROR
Error writing to PENWIN.INI file.
PMIR_INVALIDBOXEDITINFO
BOXEDITINFO structure is invalid.
PMIR_NA
Support for this value of wParam is not available.
PMIR_VALUE
lParam is invalid.

Comments

The type of information SetPenMiscInfo sets depends on wParam. The function is provided for system applications such as Control Panel. User applications should not generally call SetPenMiscInfo.

A WM_PENMISCINFO message is posted to all top-level windows whenever SetPenMiscInfo successfully changes a setting, forwarding the value for wParam. In the case of PMI_BEDIT, a WM_PENMISC message is also broadcast to ensure compatibility with version 1.0 of the Pen API. The wParam is set to PMSC_BEDITCHANGE and lParam is a far pointer to a BOXEDITINFO structure.

SetPenMiscInfo cannot set all the values available in GetPenMiscInfo because certain values are determined by the system. These values are PMI_SYSREC, PMI_CXTABLET, PMI_CYTABLET, PMI_SYSFLAGS, PMI_TICKREF, PMI_INDEXFROMRGB, and PMI_RGBFROMINDEX.

The flag PMI_SAVE can be combined with the wParam identifier for the following values: PMI_BEDIT, PMI_ENABLEFLAGS, PMI_PENTIP, PMI_TIMEOUT, PMI_TIMEOUTGEST, and PMI_TIMEOUTSEL. This forces Windows to immediately update its initialization information.

Example

The following code sample changes the pen color to red and the time out to a half second (500 milliseconds), then forces a save-file update:

PENTIP tip;

GetPenMiscInfo( PMI_PENTIP, (LPARAM)(LPPENTIP) &tip );

tip.rgb = RGB(255, 0, 0);

SetPenMiscInfo( PMI_PENTIP, (LPARAM)(LPPENTIP) &tip );

SetPenMiscInfo( PMI_TIMEOUT | PMI_SAVE, (LPARAM)500 );

See Also

GetPenMiscInfo
, WM_PENMISCINFO, PMI_

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