HeaderPane
Main
Hide
Share Link
Print

DragInfo

Returns drag & drop operation information in a SFTBOX_DRAGINFO structure.

C

LPSFTBOX_DRAGINFO WINAPI SftBox_GetDragInfo(HWND hwndCtl);

C++

LPSFTBOX_DRAGINFO CSftBox::GetDragInfo() const;

Parameters

hwndCtl

The window handle of the combo box control.

Returns

The return value is a pointer to a SFTBOX_DRAGINFO structure.

Comments

The GetDragInfo function returns drag & drop operation information in a SFTBOX_DRAGINFO structure.

Drag & drop must be enabled using SetDragType.

The contents of the SFTBOX_DRAGINFO structure returned are only valid if the calling application is currently processing a SFTBOXN_BEGINDRAG, SFTBOXN_DRAGGING, SFTBOXN_ENDDRAG or SFTBOXN_CANCELDRAG notification. When processing multiple notifications, the SFTBOX_DRAGINFO structure should be retrieved using GetDragInfo every time.

The area member of the structure describes where the drag & drop operation started, in the edit control portion (SFTBOX_AREA_EDIT) or in the dropdown portion (SFTBOX_AREA_DROPDOWN).

Some members of the structure may be modified if the application is currently processing a SFTBOXN_BEGINDRAG or SFTBOXN_DRAGGING notification.

Examples

C View entire sample code

static BOOL IsOver(HWND hwndBox, HWND hwndPoint)
{
    // A combo box consists of several windows
    return hwndPoint && (hwndPoint == hwndBox || IsChild(hwndBox, hwndPoint));
}

static void OnBeginDrag(HWND hwndSource)
{
    LPSFTBOX_DRAGINFO lpInfo = SftBox_GetDragInfo(hwndSource);

    // Remember the item being dragged. The user data is preserved
    // until the drag and drop operation ends.
    lpInfo->UserData = (SFTBOX_DWORD_PTR) SftBox_GetCurSel(hwndSource);
    if (lpInfo->area == SFTBOX_AREA_DROPDOWN && (LONG) lpInfo->UserData < 0)
        lpInfo->fAbort = TRUE;          // nothing to drag
}

C++ View entire sample code

static BOOL IsOver(const CSftBox& box, HWND hwndPoint)
{
    // A combo box consists of several windows
    return hwndPoint && (hwndPoint == box.m_hWnd || ::IsChild(box.m_hWnd, hwndPoint));
}

void CMainDlg::BeginDrag(CSftBox& source)
{
    LPSFTBOX_DRAGINFO lpInfo = source.GetDragInfo();

    // Remember the item being dragged. The user data is preserved
    // until the drag and drop operation ends.
    lpInfo->UserData = (SFTBOX_DWORD_PTR) source.GetCurSel();
    if (lpInfo->area == SFTBOX_AREA_DROPDOWN && (LONG) lpInfo->UserData < 0)
        lpInfo->fAbort = TRUE;          // nothing to drag
}

See Also C/C++ API | Categories | Notifications


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.