IDropSource::GiveFeedback  XSNMIB

Enables a source application to give visual feedback to the end user during a drag-and-drop operation by providing the DoDragDrop3YY1_Q5 function with an enumeration value specifying the visual effect.

HRESULT GiveFeedback(

    DWORD dwEffect

//Effect of a drop operation

   );

 

 

Parameter

dwEffect

[in] The DROPEFFECTVK63LO value returned by the most recent call to IDropTarget::DragEnterYJ8QYN, IDropTarget::DragOverULEBUJ, or IDropTarget::DragLeave3MK4_FV. For a list of values, see the DROPEFFECT enumeration.

 

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 DoDragDrop3YY1_Q5 function. DoDragDrop enters a loop, calling IDropTarget::DragEnterYJ8QYN when the mouse first enters a drop target window, IDropTarget::DragOverULEBUJ when the mouse changes its position within the target window, and IDropTarget::DragLeave3MK4_FV when the mouse leaves the target window.

For every call to either IDropTarget::DragEnter or IDropTarget::DragOver, DoDragDrop calls IDropSource::GiveFeedback, passing it the DROPEFFECTVK63LO value returned from the drop target call.

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 DoDragDrop3YY1_Q5 loop, so you can gain performance advantages if you optimize your implementation as much as possible.

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

DoDragDrop, IDropTarget