The following sample code shows how to replace a WPFolder object class with a WPMyFolder object class at restart of the system:
#define INCL_WINWORKPLACE #include "os2.h" PSZ pszNewClassName="WPMyFolderClass"; PSZ pszOldClassName="WPFolder"; BOOL rc; { rc = WinReplaceObjectClass(pszOldClassName, pszNewClassName, TRUE); if (rc) { /* Object will be replaced at next start of the system */ } else { /* WinReplaceObjectClass failed */ } }