Mastering PowerBuilder
Predefined Keys
Predefined keys are system-defined keys that help an application navigate in the registry. These keys also make it possible to develop tools that allow a system administrator to change whole categories of data. The following keys are defined at the root of the registry:
- HKEY_CLASSES_ROOT:
Entries within this key define types (or classes) of documents and the properties associated with those types. Data stored under this key is used by Windows shell applications and by OLE applications. This is where file viewers and shell extensions store their OLE CLSIDs, and where in-process servers are registered.
- HKEY_CURRENT_USER:
Current user preferences are stored within this key. These preferences include items such as the settings of environment variables, data about program groups, colors, printers, network connections, and application preferences. This key is included to make it easier to set the current user's settings; the key maps to the current user's branch in HKEY_USERS. Software vendors use this key to store the current user-specific preferences to be used within their applications.
- HKEY_LOCAL_MACHINE:
Entries within this key show the physical state of the computer, including data about the bus type, system memory, and installed hardware and software. This key contains subkeys that contain information about network logon preferences, network security information, software-related information (server names, location of the server, and so on).
- HKEY_USER:
This key stores information about the default user configuration and contains a branch for each user of the computer.
- HKEY_CURRENT_CONFIG:
This key is mapped to a subkey within HKEY_LOCAL_MACHINE. This is where non-user-specific configuration information that pertains to hardware is stored. For example, an application may store a different server name for its data depending on whether the system is attached to a network.
- HKEY_DYN_DATE:
This key is used to store dynamic registry data. The Windows 95 registry supports both static data (data stored on disk within the registry) and dynamic data (data that changes a lot, such as performance statistics). This dynamic data area is the mechanism provides real-time data to Win32 applications that can run remotely as well as locally. This also allows the system monitor to provide performance statistics on remote Windows 95 systems.
Coming back to GUID, GUIDs appear in various places, however, as a PowerBuilder application developer, we need to deal with .REG files only.
- .REG files:
When you create an application, you usually create one or more .REG files. The .REG files contain the GUIDs for the classes that your application exposes. These GUIDs are added to the registry when you run REGEDIT.EXE with /M option. More about this is covered in a minute.
- The system registry:
Contains the GUIDs for your classes in multiple places. This is where OLE and applications get information about your classes.
- .ODL files:
When you describe objects in an Object Description Language (.ODL) file, you provide a GUID for each object. Compiling the .ODL file with MKTYPLIB.EXE places the GUIDs in a type library, which usually exists as a .TLB file.
- .TLB files:
Type libraries describe your classes, and this information includes the GUIDs for the classes. You can browse .TLB files using the TIBROWSE sample application supplied with OLE.
- .H files:
Most application developers will declare CLSIDs for their classes in a header file using the DEFINE_GUID macro.