This example shows how to obtain the window handle of the source of a drag item.
#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */ #define INCL_DOSMEMMGR /* Memory Management Functions for */ /* DosSubAlloc */ #include <OS2.H> DRAGITEM ditem; PVOID pMem; PSZ pszBuffer; ULONG cb; BOOL rc, fResult; cb = DrgQueryNativeRMFLen(&ditem) + 1; rc = DosSubAlloc(pMem, (PVOID *) pszBuffer, cb); if (!rc) { fResult = DrgQueryNativeRMF(&ditem, cb, pszBuffer); }