COleServerItem::DoDragDrop

Call the DoDragDrop member function to perform a drag-and-drop operation.

DROPEFFECT DoDragDrop(
   LPCRECT lpRectItem,
   CPoint ptOffset,
   BOOL bIncludeLink = FALSE,
   DWORD dwEffects = DROPEFFECT_COPY | DROPEFFECT_MOVE,
   LPCRECT lpRectStartDrag = NULL 
);

Parameters

  • lpRectItem
    The item's rectangle on screen, in pixels, relative to the client area.

  • ptOffset
    The offset from lpItemRect where the mouse position was at the time of the drag.

  • bIncludeLink
    Set this to TRUE if link data should be copied to the Clipboard. Set it to FALSE if your application does not support links.

  • dwEffects
    Determines the effects that the drag source will allow in the drag operation (a combination of Copy, Move, and Link).

  • lpRectStartDrag
    Pointer to the rectangle that defines where the drag actually starts. For more information, see the following Remarks section.

Return Value

A value from the DROPEFFECT enumeration. If it is DROPEFFECT_MOVE, the original data should be removed.

Remarks

The drag-and-drop operation does not start immediately. It waits until the mouse cursor leaves the rectangle specified by lpRectStartDrag or until a specified number of milliseconds have passed. If lpRectStartDrag is NULL, a default rectangle is used so that the drag starts when the mouse cursor moves one pixel.

The delay time is specified by a registry key setting. You can change the delay time by calling CWinApp::WriteProfileString or CWinApp::WriteProfileInt. If you do not specify the delay time, a default value of 200 milliseconds is used. Drag delay time is stored as follows:

  • Windows NT   Drag delay time is stored in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\NT\CurrentVersion\IniFileMapping\win.ini\Windows\DragDelay.

  • Windows 3.x   Drag delay time is stored in the WIN.INI file, under the [Windows} section.

  • Windows 95/98   Drag delay time is stored in a cached version of WIN.INI.

For more information about how drag delay information is stored in either the registry or the .INI file, see WriteProfileString in the Windows SDK.

Requirements

Header: afxole.h

See Also

Reference

COleServerItem Class

Hierarchy Chart

COleDataSource::DoDragDrop

COleServerItem::CopyToClipboard

Other Resources

COleServerItem Members