Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

SFTTREE_SORTPROC_ITEM Type Definition

Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents.

typedef int (CALLBACK* SFTTREE_SORTPROC_ITEM)(
        HWND hwnd, 
        LPCTSTR lpszString1,
        LPCTSTR lpszString2,
        LONG index1,
        LONG index2);

Parameters

hwnd

The window handle of the tree control.

lpszString1

The string component of the first item to sort. This parameter may be NULL if no string component is available (see AddString and InsertString).

lpszString2

The string component of the second item to sort. This parameter may be NULL if no string component is available (see AddString and InsertString).

index1

The zero-based item index of the first item to sort. This item index can be used to retrieve item values that are otherwise not accessible.

index2

The zero-based item index of the second item to sort. This item index can be used to retrieve item values that are otherwise not accessible.

Returns

The return value is 0 if the two items compare as being equal, 1 if the first item is greater than the second item, -1 if the first item is smaller than the second item.

Comments

SFTTREE_SORTPROC_ITEM defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents.

An application can sort items based on their column contents (lpszString1 and lpszString2) or based on other item values, which can be retrieved using the supplied item index values (index1 and index2). A comparison callback is defined using the SFTTREE_SORTPROC_ITEM type. The callback returns 0 if the items compare as being equal, 1 if the first item is greater than the second item, -1 if the first item is smaller than the second item.

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