The following sample code shows how to add a new object of class WPFolder to the Desktop container:
#define INCL_WINWORKPLACE #include "os2.h" PSZ pszObjTitle = "Sample Object"; HOBJECT hobj; { hobj = WinCreateObject("WPFolder", pszObjTitle, "OBJECTID=<WP_SAMPLE>", <WP_DESKTOP>, CO_FAILIFEXISTS); if (hobj != NULLHANDLE) { /* Object was successfully created on the Desktop */ } else { /* WinCreateObject failed */ } }