IDropSource::GiveFeedback
Enables a
source application to give visual feedback to the end user during a
drag-and-drop operation by providing the DoDragDrop
HRESULT GiveFeedback(
DWORD dwEffect |
//Effect of a drop operation |
); |
|
Parameter
dwEffect
[in] The DROPEFFECT
Return Values
This method
supports the standard return values E_INVALIDARG, E_UNEXPECTED, and
E_OUTOFMEMORY, as well as the following:
S_OK
The method
completed its task successfully, using the cursor set by the source
application.
DRAGDROP_S_USEDEFAULTCURSORS
Indicates
successful completion of the method, and requests OLE to update the cursor
using the OLE-provided default cursors.
Remarks
When your
application detects that the user has started a drag-and-drop operation, it
should call the DoDragDrop function. DoDragDrop enters a loop, calling
IDropTarget::DragEnter
when the mouse first enters a drop target window, IDropTarget::DragOver when the mouse changes its
position within the target window, and IDropTarget::DragLeave when the mouse leaves the
target window.
For every
call to either IDropTarget::DragEnter or IDropTarget::DragOver, DoDragDrop
calls IDropSource::GiveFeedback, passing it the DROPEFFECT
DoDragDrop calls IDropTarget::DragLeave when the mouse
has left the target window. Then, DoDragDrop calls IDropSource::GiveFeedback
and passes the DROPEFFECT_NONE value in the dwEffect parameter.
The dwEffect
parameter can include DROPEFFECT_SCROLL, indicating that the source should put
up the drag-scrolling variation of the appropriate pointer.
OLE defines a
recommended set of cursor shapes that your application should use. See the User
Interface Guidelines for more information.
Notes to Implementers
This function
is called frequently during the DoDragDrop
IDropSource::GiveFeedback is responsible for changing the cursor shape or for
changing the highlighted source based on the value of the dwEffect
parameter. If you are using default cursors, you can return
DRAGDROP_S_USEDEFAULTCURSORS, which causes OLE to update the cursor for you,
using its defaults.
See Also