Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This structure contains information used to sort child items in a tree view control.

Syntax

typedef struct _TVSORTCB { 
  HTREEITEM 
hParent; 
  PFNTVCOMPARE 
lpfnCompare; 
  LPARAM 
lParam; 
} TVSORTCB, FAR* LPTVSORTCB; 

Members

hParent

Handle to the parent item.

lpfnCompare

Long pointer to an application-defined callback function, which is called during a sort operation each time the relative order of two list items needs to be compared. The callback function has the following form.

Copy Code
int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2,
 LPARAM lParamSort); 

The callback function must return a negative value if the first item should precede the second, a positive value if the first item should follow the second, or zero if the two items are equivalent.

The lParam1and lParam2parameters of the callback function correspond to the lParammember of the TV_ITEMstructure for the two items being compared. The lParamSortmember corresponds to the lParammember of TV_SORTCB.

lParam

Application-defined 32-bit value that gets passed as the lParamSortparameter in the callback function specified in lpfnCompare.

Requirements

Header commctrl.h
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also