DM PRINTOBJECT
This message is posted to a source that supports the "DRM_PRINT" rendering method when objects are dropped on a printer object.
Syntax
param1 PDRAGITEM pDragItem; /* Pointer to the DRAGITEM structure representing the objects to be printed. */ param2 PPRINTDEST pPrintDest; /* Pointer to the PRINTDEST structure representing printer object to print to. */
Parameters
- pDragItem (PDRAGITEM) - Input
- Pointer to the DRAGITEM structure representing the objects to be printed.
- pPrintDest (PPRINTDEST) - Input
- Pointer to the PRINTDEST structure representing printer object to print to. The structure contains all the parameters required to call the functions DevPostDeviceModes and DevOpenDC.
Returns
- ulAction (ULONG) - returns
- Flag:
- DRR_SOURCE: The source window procedure/object procedure will take responsibility for the print operation.
- DRR_TARGET: The target printer object will take responsibility for the print operation (this will only work on objects which are of the pre-registered rendering method; "DRM_OS2FILE").
- DRR_ABORT: Abort the entire DM_DROP action (do not send any more DM_PRINTOBJECT messages to any selected source object involved in this DM_DROP).
Remarks
This message is posted to the source window procedure. The source window procedure is responsible for interpreting the structure given by param2. It should make a copy of all the parameters and then return.
The receiver of this message should create a thread in which to dispatch this message in order to facilitate a prompt reply. The thread can then call DevPostDeviceModes and DevOpenDC as appropriate.
- Note
- ; Technically, the message is sent, but it is from a spun-off thread so the effect is that of a posted message - it is not synchronous.
All the drag and drop protocol messages occur synchronously during the DrgDrag call. If the DM_PRINTOBJECT message is returned to the application asynchronously, by the time the application gets the message, the DRAGINFO structure (and DRAGITEM inside) have already been freed. The application will trap when it tries to use param1 of the DM_PRINTOBJECT message (the pointer to the DRAGITEM data structure).
For debugging purposes, the application can keep a static copy of the DRAGINFO pointer and use DrgAccessDraginfo to reaccess the shared DRAGINFO structure during DM_PRINTOBJECT message processing.
Default Processing
The WinDefWindowProc function does not expect to receive this message and takes no action on it, other than to set ulAction to the default value of NULL.