This example calls the DrgDragFiles function to begin direct manipulation for a single file object, using the same source and target name, and determining the file type based on the file's type EA.
#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */
#define INCL_WININPUT /* Window Input Functions */
#include <os2.h>
BOOL fSuccess; /* Indicate success or failure */
HWND Hwnd; /* Handle of calling window */
PSZ pFiles[1]; /* The names of the files to be dragged */
PSZ pTypes[1]; /* The file types of the files to be */
/* dragged */
PSZ pTargets[1]; /* The target file names */
HPOINTER hptrDrag; /* Icon to display during drag */
pFiles[0] = "FILENAME.EXT"; /* Copy file name to string array */
pTargets[0] = NULL; /* Use source name as target name */
pTypes[0] = NULL; /* Query type EA to determine file type */
fSuccess = DrgDragFiles(Hwnd, pFiles, pTypes, pTargets, 1,
hptrDrag, VK_BUTTON2, FALSE, 0L);