The following sample code shows how to move the Drives object onto the Desktop:

#define INCL_WINWORKPLACE
#include "os2.h"

HOBJECT    hObjectofDest;
HOBJECT    hObjectofObject;
HOBJECT    hObjectofResult;

hObjectofObject = WinQueryObject("<WP_DRIVES>");
if (hObjectofObject != NULL)
{
  /* WinQueryObject of Drives was successful */
  hObjectofDest = WinQueryObject("<WP_DESKTOP>");

  if (hObjectofDest != NULL)
  {
    /* WinQueryObject of Startup was successful */
    hObjectofResult = WinMoveObject(hObjectofObject,
                                    hObjectofDest,
                                    0);

    if (hObjectofResult != NULL)
    {
      /* Drives object was successfully moved to the Desktop */
    }
    else
    {
      /* Move failed */
    }
  }
}


[Back] [Next]