IImageList::BeginDrag method (commoncontrols.h)

Begins dragging an image.

Syntax

HRESULT BeginDrag(
  [in] int iTrack,
  [in] int dxHotspot,
  [in] int dyHotspot
);

Parameters

[in] iTrack

Type: int

A value of type int that contains the index of the image to drag.

[in] dxHotspot

Type: int

A value of type int that contains the x-component of the drag position relative to the upper-left corner of the image.

[in] dyHotspot

Type: int

A value of type int that contains the y-component of the drag position relative to the upper-left corner of the image.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

IImageList::BeginDrag creates a temporary image list that is used for dragging. In response to subsequent WM_MOUSEMOVE messages, you can move the drag image by using IImageList::DragMove. To end the drag operation, you can use IImageList::EndDrag.

To use IImageList::BeginDrag, specify Comctl32.dll version 6 in the manifest. For more information on manifests, see Enabling Visual Styles.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header commoncontrols.h
DLL Comctl32.dll (version 6.0 or later)