The following sample code shows how to enumerate all classes registered with the system:

#define INCL_WINWORKPLACE
#include "os2.h"

PULONG    ulSize;
POBJCLASS pObjClass;
BOOL      rc;

{
  /* Get the buffer size required to hold all registered classes */
  if (WinEnumObjectClasses(NULL, &ulSize)
     &&
     (pmem = (PVOID) AllocMem (ulSize, NULL)))
  {
    pObjClass = (POBJCLASS)pmem;
    rc = WinEnumObjectClasses(pObjClass, &ulSize)
    if (rc)
    {
      /* pObjClass contains all classes registered with the system */
    }
    else
    {
      /* WinEnumObjectClasses failed */
    }
}


[Back] [Next]