In this example, the DrgVerifyTypeSet function is used to determine whether DRT_TEXT is among the types associated with the object. If it is, the drop is accepted.
#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */ #include <OS2.H> #include <stdio.h> BOOL flResult; DRAGITEM pditem; char szBuffer[32]; case DM_DRAGOVER: flResult = DrgVerifyTypeSet(&pditem, DRT_TEXT, sizeof(szBuffer), szBuffer); flResult = strcmp(szBuffer,DRT_TEXT); /**************************************************************/ /* See if the object is an OS/2 file as well as being of text */ /* format. AND result flag with previous result flag to get */ /* the "effective" return code. */ /**************************************************************/ flResult = DrgVerifyRMF(&pditem,"DRM_OS2FILE","DRF_TEXT"); /**************************************************************/ /* See if DRT_TEXT is the true type of the object */ /**************************************************************/ flResult = DrgVerifyTrueType(&pditem,"DRF_TEXT"); if(!flResult) /**************************************************************/ /* Inform the application that you will accept the drop */ /**************************************************************/ return(MRFROM2SHORT(DOR_DROP, DO_COPY)); break;