Registry Configuration

In version 1.0, the PENWIN.INI file contained system configuration information such as the name of the default recognizer and the time-out value for selection. Version 2.0 removes configuration information from the PENWIN.INI file and instead stores it in the system registry.

For example, the following code fragment sets the fictitious recognizer RECOG1.DLL as the default system recognizer. The code presumes that RECOG1.DLL:

  • Resides in a location where Windows can find it (usually the system subdirectory).

  • Is capable of taking on the role of system recognizer.

For more information about recognizers, see Chapter 8, "Writing a Recognizer." For descriptions of the registry functions RegSetValueEx, RegCreateKey, and RegCloseKey, see the documentation included in the Win32 Software Develop-ment Kit.

HKEY hk; // Key handle returned by RegCreateKey

.

.

.

// Open (or create) the registry for the parent key

if ((lRes = RegCreateKey( HKEY_LOCAL_MACHINE,

(LPSTR)REGSTR_PATH_CONTROL,

&hk )) == ERROR_SUCCESS)

{

// If successful, set "RECOG1.DLL" as the system recognizer

RegSetValueEx( hk, REGSTR_VAL_PEN_RECOG, NULL, REG_SZ,

(LPBYTE)(LPSTR)"RECOG1.DLL", 0 );

// Close it

RegCloseKey( hk );

}

The PENREG.H header file defines values pertaining to the system registry. Note that, generally, applications should not change the system configuration, relying instead on the user to do so through the Control Panel.

For information on retrieving and setting other pen system parameters, see the reference entries for GetPenMiscInfo and SetPenMiscInfo in Chapter 10, "Pen Application Programming Interface Functions."

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