CN DRAGOVER
This message is sent by the container control to its owner whenever the container receives a DM_DRAGOVER message. The CN_DRAGOVER notification code is sent only if the CA_ORDEREDTARGETEMPH attribute of the CNRINFO data structure is not set or the current view is the icon view or tree view.
Syntax
param1 USHORT id; /* Container control ID. */ USHORT CN_DRAGOVER; /* Notification code. */ param2 PCNRDRAGINFO pCnrDragInfo; /* Pointer to a CNRDRAGINFO structure. */ returns USHORT usDrop; /* Drop indicator. */ USHORT usDefaultOp; /* Default operation. */
Parameters
- id (USHORT) - Input
- Container control ID.
- CN_DRAGOVER (USHORT) - Input
- Notification code.
- pCnrDragInfo (PCNRDRAGINFO) - Input
- Pointer to a CNRDRAGINFO structure.
Returns
- usDrop (USHORT) - returns
- Drop indicator.
- DOR_DROP: The record can be dropped. When this response is returned, the container control applies target emphasis.
- DOR_NODROP: The record is acceptable and the current operation is supported by the target, but the record cannot be dropped in the current location. For example, the container control returns DOR_DROP if the record being dragged is positioned over another record on which it cannot be dropped. If the container returns DOR_NODROP, the DM_DRAGOVER message will continue to be sent to it when the user does any of the following: moves the pointer, presses a keyboard key, moves the pointer out of and back into the container window.
- DOR_NODROPOP: The record is acceptable, but the target does not support the current operation. This response implies that the drop may be valid if the drag operation changes. For example, if the default operation is copy and the target does not support this operation, the drop may become valid if the user presses a keyboard augmentation key to change to a different operation, such as move. If the container returns DOR_NODROPOP, no further DM_DRAGOVER messages are sent until the user does any of the following: presses a keyboard key, moves the pointer out of and back into the container window.
- DOR_NEVERDROP: The record cannot be dropped. Target emphasis is not drawn. If the container returns DOR_NEVERDROP, no further DM_DRAGOVER messages are sent until the user drags the record outside of and back into the container window.
- usDefaultOp (USHORT) - returns
- Default operation.
- DO_COPY: Operation is a copy.
- DO_DEFAULT: Operation is the default drag operation. No modifier keys are pressed.
- DO_LINK: Operation is a link.
- DO_MOVE: Operation is a move.
- DO_UNKNOWN: Operation is application-defined.
Remarks
This notification code shows where direct manipulation is occurring by applying target emphasis to indicate whether an item that is being dragged over the container can be dropped. It is not necessary for the application to draw any target emphasis for the container when it receives this notification code.
If the pointer is over a container record and the item that is being dragged can be dropped on that record, the container draws a black rectangle around the target record. If the pointer is over white space and the item that is being dragged can be dropped on the white space, the container draws a black border around the edge of the client area.
If the container returns anything except DOR_DROP, the target emphasis is automatically changed to a symbol that indicates no drop is allowed. This gives the user a visual cue that a drop cannot occur. The symbol reverts to the black rectangle or black border when the container returns a DOR_DROP reply.
The CN_DRAGOVER notification code is sent only for the icon and tree views, or when the CA_ORDEREDTARGETEMPH attribute of the CNRINFO data structure is not set. If this attribute is set and the current view is the name, text, or details view, the CN_DRAGAFTER notification code is sent.
The return parameter is reserved.
Default Processing
The default window procedure does not expect to receive this notification code and therefore takes no action on it other than to return 0.