10.4 SHELL.DLL Functions

SHELL.DLL contains functions used by the setup program to register OLE server applications in the registration database. The include file, SHELLAPI.H, contains prototypes for these functions. (These functions are fully described in the Microsoft Windows 3.1 Software Development Kit.)

Function Description

RegCreateKey Creates a key given a name, generates a key handle.
RegSetValue Sets the text string (value) for a specified key.
RegDeleteKey Deletes a key given a key handle and a subkey name.
RegCloseKey Closes a key given a key handle.
RegQueryValue Retrieves text string for specified key.
RegEnumKey Enumerates subkeys of specified key into a string.
RegOpenKey Opens a key given a name, providing a key handle.

A setup program uses the RegCreateKey, RegSetValue, and RegCloseKey functions to install the required keys in the system registration database. In the event of an error, the program can delete a key with RegDeleteKey.

The RegQueryValue function can be used by the server application each time it starts to make sure that it is properly registered.