IDropTarget::DragOver
Provides
target feedback to the user and communicates the drop s effect to the DoDragDrop
HRESULT DragOver(
DWORD grfKeyState, |
//Current state of keyboard modifier keys |
POINTL pt, |
//Pointer to the current cursor coordinates |
DWORD * pdwEffect |
//Pointer to the effect of the drag-and-drop
operation |
); |
|
Parameters
grfKeyState
[in] Current
state of the keyboard modifier keys on the keyboard. Valid values can be a
combination of any of the flags MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON,
MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON.
pt
[in] Pointer
to the current cursor coordinates in the coordinate space of the drop-target
window.
pdwEffect
[in, out]
Pointer to the current effect flag. Valid values are from the enumeration DROPEFFECT
Return Values
This method
supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and
E_UNEXPECTED, as well as the following:
S_OK
The method
completed its task successfully.
Remarks
You do not
call IDropTarget::DragOver directly. The DoDragDrop
In
implementing IDropTarget::DragOver, you must provide features similar to
those in IDropTarget::DragEnter
Key
Combination |
User-Visible
Feedback |
Drop
Effect |
CTRL + SHIFT |
= |
DROPEFFECT_LINK |
CTRL |
+ |
DROPEFFECT_COPY |
No keys or SHIFT |
None |
DROPEFFECT_MOVE |
You
communicate the effect of the drop back to the source through DoDragDrop5ZW3L4 so the source application can display the
appropriate visual feedback to the user.
On entry to IDropTarget::DragOver,
the pdwEffect parameter must be set to the allowed effects passed to the
pdwOkEffect parameter of the DoDragDrop function. The IDropTarget::DragOver
method must be able to choose one of these effects or disable the drop.
Upon return, pdwEffect
is set to one of the members of the DROPEFFECT enumeration. This value is then
passed to the pdwEffect parameter of DoDragDrop
You may also
wish to provide appropriate visual feedback in the target window. There may be
some target feedback already displayed from a previous call to IDropTarget::DragOver
or from the initial IDropTarget::DragEnter
For
efficiency reasons, a data object is not passed in IDropTarget::DragOver.
The data object passed in the most recent call to IDropTarget::DragEnter
is available and can be used.
When IDropTarget::DragOver
has completed its operation, the DoDragDrop function calls IDropSource::GiveFeedback
Notes to Implementers
This function
is called frequently during the DoDragDrop
See Also