|
IDropSource::GiveFeedback
Enables a source application to give visual feedback to its end user during a
drag-and-drop operation by providing the DoDragDrop function with an enumeration value specifying the visual effect.
HRESULT GiveFeedback(
DWORD dwEffect
| //Effect of a drop operation
| );
|
|
Parameter
dwEffect
[in] Specifies the DROPEFFECT value returned by the most recent call to IDropTarget::DragEnter, IDropTarget::DragOver, or IDropTarget::DragLeave. For a list of values, see the DROPEFFECT enumeration.
Return Values
S_OK
The function completed its task successfully using the cursor set by the
source application.
DRAGDROP_S_USEDEFAULTCURSORS
The function completed successfully using the OLE-provided, default cursor.
E_INVALIDARG
One or more arguments are invalid.
E_OUTOFMEMORY
Out of memory.
E_UNEXPECTED
An unexpected error occurred.
Comments
When your application detects that the user has started a drag-and-drop
operation, you 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 value returned from the drop target call. IDropSource::GiveFeedback is responsible for changing the cursor shape or for changing the highlighted
source based on the value of the dwEffect parameter.
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 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 Implementors
This function is called frequently during the DoDragDrop loop so you can gain performance advantages if you optimize your
implementation as much as possible.
See Also
DoDragDrop, IDropTarget
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|