The following sample code shows how to register a new class, WPSample, with the Workplace Shell and later shows how to deregister it:

#define INCL_WINWORKPLACE
#include "os2.h"

PSZ  pszClassName="WPSample";
PSZ  pszModName="test.dll";
BOOL fReturn;

{
  fReturn = WinRegisterObjectClass(pszClassName, pszModName);
  if (fReturn)
  {
    /* WPSample class was successfully registered */
  }
  else
  {
    /* WinRegisterObjectClass failed */
   }
   .
   .
   .

   /* Later you would want to deregister the object */
   fReturn = WinDeregisterObjectClass(pszClassName);
   if (fReturn)
   {
     /* WPSample class was successfully deregistered */
   }
   else
   {
     /* WinDeregisterObjectClass failed */
    }
}


[Back] [Next]