Jump to content

DrgVerifyTrueType

From EDM2

This function determines if the true type of a dragged object matches an application-supplied type string.

Syntax

DrgVerifyTrueType(pDragitem, pType)

Parameters

pDragitem (PDRAGITEM) - input
Pointer to the DRAGITEM structure whose true type is to be verified.
pType (PSZ) - input
String specifying a type. This string is in the format: type[,type...]

Returns

rc (BOOL) - returns
Validity indicator.
TRUE - Successful completion.
FALSE - Error occurred.

Remarks

If an item in the string pointed to by pType matches the first type in the string associated with hstrType in the DRAGITEM structure, TRUE is returned. A target application uses this function to determine if it supports the true type of a dragged object. If the application does not support the true type, it can either disallow a drop or change its default operation. If the default operation is a move, the drop should be disallowed, or the operation changed to a copy to prevent any loss of data for the object.

Example Code

This example verifies whether a given type is present in the list of types defined for a drag object.

#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */
#include <OS2.H>
#include <string.h>

BOOL     fValid;
DRAGITEM Dragitem; /* DRAGITEM structure whose hstrType is */
                   /* to be verified                       */
char     pszType[8]; /* A string specifying the types to    */
                    /* search for                           */

strcpy(pszType,"DRT_EXE"); /* Executable file type. See the      */
                           /* DRAGINFO structure for valid       */
                           /* types.                             */
fValid = DrgVerifyTrueType(&Dragitem, pszType);

Related Functions