For the Workplace Shell to know how to manipulate objects on the user's behalf, it must know about the object class and the class definition, that is, its data and methods. Therefore, object classes must be registered with the Workplace Shell. The following functions enable applications to affect object classes registered with the Workplace Shell:
WinEnumObjectClasses enables an application to get the list of all Workplace Shell object classes that have been registered with the Workplace Shell.
WinRegisterObjectClass and WinDeregisterObjectClass permit an application to register and deregister Workplace Shell object classes with the Workplace Shell. WinRegisterObjectClass registers the specified Workplace Shell object class that is defined in the specified DLL module that was created using the SOM compiler. The name of the object class must match the library name specified in the DEF file used to build the DLL. Because all registered classes are maintained in the OS2.INI file and are cached upon system initialization, a class should be removed, if it is no longer needed.
WinReplaceObjectClass is used to replace a registered object class with another class. The replacement class is a subclass of the class being replaced. This type of class is useful for modifying the behavior of instances of a Workplace Shell object class without the instances being aware of the new class. WinReplaceObjectClass also is used to undo the replacement and restore the original class that defines the behavior of its instances.