DrgPostTransferMsg - Example Code

This example calls the DrgPostTransferMsg function to respond to a DM_RENDER message from the target. The response consists of a DM_RENDERCOMPLETE message, plus a flag indicating whether the render was successful (DMFL_RENDEROK) or not (DMFL_RENDERFAIL).

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

MPARAM        mp1;      /* Message parameter 1                   */
BOOL          fSuccess; /* Indicate success or failure           */
BOOL          Rendered; /* Success of render operation           */
PDRAGTRANSFER pdxfer;   /* Pointer to DRAGTRANSFER structure     */

case DM_RENDER:
   pdxfer = (PDRAGTRANSFER)PVOIDFROMMP(mp1); /* Get DRAGTRANSFER */
                                             /* structure        */

     /************************************************************/
     /* Attempt to render file                                   */
     /************************************************************/

     if (Rendered)
        {
        fSuccess = DrgPostTransferMsg(pdxfer->pditem,
                                      DM_RENDERCOMPLETE,
                                      pdxfer,
                                      DMFL_RENDEROK,
                                      0,FALSE);
        return (MRESULT)TRUE;
        }
     else
        {
        fSuccess = DrgPostTransferMsg(pdxfer->pditem,
                                      DM_RENDERCOMPLETE,
                                      pdxfer,
                                      DMFL_RENDERFAIL,
                                      0,FALSE);
        return (MRESULT)FALSE;
        }


[Back: DrgPostTransferMsg - Related Functions]
[Next: DrgPostTransferMsg - Topics]