DM DRAGOVER
This message allows the window under the mouse pointer to determine if the object or objects currently being dragged can be dropped. param2 is the pointing device pointer location.
Syntax
param1 PDRAGINFO pDraginfo; /* Pointer to the DRAGINFO structure representing the object being dragged. */ param2 SHORT sxDrop; /* X-coordinate of the pointing device pointer in desktop coordinates. */ SHORT syDrop; /* Y-coordinate of the pointing device pointer in desktop coordinates. */ returns USHORT usDrop; /* Drop indicator. */ USHORT usDefaultOp; /* Target-defined default operation. */
Parameters
- pDraginfo (PDRAGINFO) - Input
- Pointer to the DRAGINFO structure representing the object being dragged.
- sxDrop (SHORT) - Input
- X-coordinate of the pointing device pointer in desktop coordinates.
- syDrop (SHORT) - Input
- Y-coordinate of the pointing device pointer in desktop coordinates.
Returns
- usDrop (USHORT) - returns
- Drop indicator.
- DOR_DROP: Object can be dropped. When this reply is given, usDefaultOp must be set to indicate which operation is performed if the user should drop at this location.
- DOR_NODROP: Object cannot be dropped at this time. The target can accept the object in the specified type and format using the specified operation, but the current state of the target will not allow it to be dropped on. The target may change state in the future so that the same object may be acceptable.
- DOR_NODROPOP: Object cannot be dropped at this time. The target can accept the object in the specified type and format, but the current operation is not acceptable. A change in the drag operation may change the acceptability of the object.
- DOR_NEVERDROP: Object cannot be dropped. The target cannot accept the object now and will not change state so that the object will be acceptable in the future. If this response is returned, no more DM_DRAGOVER messages will be sent to the target until the pointer is moved out of and back into the target window.
- usDefaultOp (USHORT) - returns
- Target-defined default operation.
- DO_COPY: Default operation is a copy.
- DO_LINK: Default operation is a link.
- DO_MOVE: Default operation is a move.
- DO_CREATE: Default operation is create. Used to create an object from a template.
- DO_NEW: Default operation is create another. Use create another to create an object that has default settings and data. The result of using create another is identical to creating an object from a template. This value should be defined as DO_UNKNOWN+3 if it is not recognized in the current level of the toolkit.
- Other: Operation is defined by the application. This value should be greater than or equal to (>=) DO_UNKNOWN but not DO_NEW.
Remarks
This message is sent to the window that is directly under the hot spot of the mouse pointer during the drag operation when any of the following conditions are met:
- The user moves the mouse.
- A key is pressed.
- A WM_BUTTON1UP, WM_BUTTON2UP, WM_BUTTON3UP, or WM_ENDDRAG message is received. The message corresponds to the parameter specified by the call to DrgDrag indicating that the drag is ending. In this case, the message is sent only if the mouse has moved since the last DM_DRAGOVER message was sent.
The receiver can gain access to the DRAGINFO structure with DrgAccessDraginfo. The acceptability of the dragged objects can be determined by querying the hstrType and hstrRMF string handles in each of the DRAGITEM structures carried in the DRAGINFO structure. In order to accept the drop, the target window must be able to accept all of the objects that are being dragged.
The receiver should provide target emphasis for itself. The receiver can use DrgSetDragPointer to change the bit map while it is being dragged over. A DM_DRAGLEAVE or DM_DROP message will be sent to the target in the future. Target emphasis should be removed at that time.
If usOperation in DRAGINFO is DO_DEFAULT or DO_UNKNOWN and the target returns DOR_DROP for usDrop, usDefaultOp should be set to reflect what the target defines as the default operation. This information is used to provide the appropriate modification to the drag pointer, and the target's default operation will be passed in the usOperation field of the DRAGINFO structure specified in the DM_DROP message.
If the value of the usOperation field is not DO_DEFAULT or DO_UNKNOWN, the usDefaultOp parameter is ignored.
Note: Lazy drag enabled applications are expected to process this message. It is to be handled in the same manner as the standard drag enabled applications.
Default Processing
The WinDefWindowProc function returns DOR_NEVERDROP to the sender of this message.