TVSORTCBTVSORTCB*
*Contents  *Index  *Topic Contents
*Previous Topic: TVITEMEX
*Next Topic: Up-Down Controls

TVSORTCB


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

Contains information used to sort child items in a tree view control. This structure is used with the TVM_SORTCHILDRENCB message. This structure is identical to the TV_SORTCB structure, but it has been renamed to follow current naming conventions.

hParent
Handle to the parent item.
lpfnCompare
Address of 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:
 
	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 lParam1 and lParam2 parameters correspond to the lParam member of the TVITEM structure for the two items being compared. The lParamSort parameter corresponds to the lParam member of this structure.

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

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.