This example uses the DrgAcceptDroppedFiles function to define the direct manipulation protocol of the given window, accept all file types, and use the current directory as the drop directory.
#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */ #include <os2.h> BOOL fSuccess; /* Indicate success or failure */ HWND Hwnd; /* Handle of calling window */ PSZ pszPath; /* Directory in which to place the */ /* dropped files */ PSZ pszTypes; /* A list of types that are acceptable */ ULONG ulDefaultOp; /* Default drag operation */ pszPath = NULL; /* Drop file in current directory */ pszTypes = NULL; /* Accept any file type */ ulDefaultOp = DO_MOVE; /* Default drag operation is move */ fSuccess = DrgAcceptDroppedFiles(Hwnd, pszPath, pszTypes, ulDefaultOp, 0);