Jump to content

DrgPostTransferMsg

From EDM2
Revision as of 00:19, 8 April 2025 by Iturbide (talk | contribs) (Created page with "This function posts a message to the other application involved in the direct manipulation operation. ==Syntax== DrgPostTransferMsg(hwnd, msg, pdxfer, fl, ulRsvd, fRetry) ==Parameters== ;hwnd (HWND) - input: Window handle to which the message is to be posted. :: '''Target''': hwndItem in the DRAGITEM structure. :: '''Source''': hwndClient in the DRAGTRANSFER structure. ;msg (ULONG) - input: Identifier of the message to be posted. :: DM_RENDERCOMPLETE is the on...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function posts a message to the other application involved in the direct manipulation operation.

Syntax

DrgPostTransferMsg(hwnd, msg, pdxfer, fl, ulRsvd, fRetry)

Parameters

hwnd (HWND) - input
Window handle to which the message is to be posted.
Target: hwndItem in the DRAGITEM structure.
Source: hwndClient in the DRAGTRANSFER structure.
msg (ULONG) - input
Identifier of the message to be posted.
DM_RENDERCOMPLETE is the only valid message.
pdxfer (PDRAGTRANSFER) - input
Pointer to the DRAGTRANSFER structure.
fl (ULONG) - input
Flags to be passed in the param2 parameter of the message identified by msg.
ulRsvd (ULONG) - input
Reserved value, must be 0.
fRetry (BOOL) - input
Retry indicator.
TRUE - If the destination queue is full, the message posting is retried at 1-second intervals until the message is posted successfully. In this case, DrgPostTransferMsg dispatches any messages in the queue by calling WinPeekMsg and WinDispatchMsg in a loop. The application can receive messages sent by other applications while it is trying to post drag transfer messages.
FALSE - The call returns FALSE without retrying.

Returns

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

Remarks

The fsReply field in the DRAGTRANSFER structure is set to 0 before the message is posted. If the posting fails for any reason, FALSE is returned.

Example Code

#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;
   }

Related Functions