This example calls the DrgAddStrHandle function to create handles for strings that are used in a DRAGITEM structure.
#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */ #include <os2.h> USHORT ID_ITEM = 1; /* Drag item identifier */ HWND hwnd; /* Window handle */ DRAGITEM ditem; /* DRAGITEM structure */ /* Initialize the DRAGITEM structure */ ditem.hwndItem = hwnd; /* Conversation partner */ ditem.ulItemID = ID_ITEM; /* Identifies item being dragged */ ditem.hstrType = DrgAddStrHandle(DRT_TEXT); /* Item is text */ ditem.hstrRMF = DrgAddStrHandle("<DRM_OS2FILE,DRF_TEXT>"); ditem.hstrContainerName = DrgAddStrHandle("C:\\"); ditem.hstrSourceName = DrgAddStrHandle("C:\\CONFIG.SYS"); ditem.hstrTargetName = DrgAddStrHandle("C:\\OS2\\CONFIG.SYS"); ditem.cxOffset = 0; /* X-offset of the origin of the */ /* image from the pointer hotspot*/ ditem.cyOffset = 0; /* Y-offset of the origin of the */ /* image from the pointer hotspot*/ ditem.fsControl = 0; /* Source item control flags */ /* object is open */ ditem.fsSupportedOps = 0;