This example moves 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 copied to the Desktop */
    }
    else
    {
      /* Move failed */
    }
  }
}


[Back] [Next]