-
Notifications
You must be signed in to change notification settings - Fork 13
/
TreeListWnd.h
432 lines (389 loc) · 23.7 KB
/
TreeListWnd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
//*****************************************************************************
//*
//*
//* TreeListWnd.h
//*
//*
//*****************************************************************************
#ifndef __TREELISTWND_H__
#define __TREELISTWND_H__
#if _MSC_VER > 1000
#pragma once
#endif
#include <commctrl.h>
typedef int (CALLBACK *PFNTVCOMPAREEX)(HWND hWnd,HTREEITEM hItem1,HTREEITEM hItem2,LPARAM lParam1,LPARAM lParam2,LPARAM lParam);
typedef int (CALLBACK *PFNTVSORTEX )(HWND hWnd,HTREEITEM hItem ,LPCTSTR pTextItem,LPCTSTR pTextInsert,LPARAM lParamItem,LPARAM lParamInsert);
typedef struct {
HTREEITEM hParent;
PFNTVCOMPAREEX lpfnCompare;
LPARAM lParam;
} TVSORTEX;
typedef struct {
UINT uFlags;
UINT uColumn;
UINT uState;
UINT uStateMask;
LPARAM lParam;
LPCTSTR pText;
} TVFIND;
typedef struct {
NMHDR hdr;
WORD wVKey;
WORD wScan;
UINT flags;
} TV_KEYDOWN_EX;
typedef struct {
NMHDR hdr;
TVITEM item;
UINT uAction;
UINT uHeight;
UINT uMaxEntries;
LPCTSTR pTextEntries;
LPCTSTR *pTextList;
POINT ptAction;
} TV_STARTEDIT;
typedef struct {
NMHDR hdr;
UINT uColumn;
UINT uIndex;
UINT uPosX;
INT iSize;
} TV_COLSIZE;
typedef TVSORTEX *LPTVSORTEX;
typedef TVSORTEX *LPTV_SORTEX;
typedef TVSORTEX TV_SORTEX;
#define TVCOLUMN LV_COLUMN
#define TV_COLUMN LV_COLUMN
#define TV_FIND TVFIND
#define TV_NOIMAGE (-2)
#define TV_NOCOLOR 0xFFFFFFFF
#define TV_NOAUTOEXPAND 0x20000000
#define TV_SECONDICON 0x40000000
#define TVLE_DONOTIFY 0xF5A5A500
#define TVIF_TEXTPTR 0x80000000
#define TVIF_TOOLTIPTIME 0x40000000
#define TVIF_TEXTCHANGED 0x20000000
#define TVIF_RETURNEXIT 0x10000000
#define TVIF_CASE 0x08000000
#define TVIF_NEXT 0x04000000
#define TVIF_CHILD 0x02000000
#define TVIF_CANCELED 0x01000000
#define TVIF_ONLYFOCUS 0x00800000
#define TVIF_SUBITEM 0x8000
#define TVIF_SUBNUMBER 0x4000
#define TVIS_UNDERLINE 0x0001
#define TVSIL_CHECK 0x0003
#define TVSIL_SUBIMAGES 0x0004
#define TVSIL_HEADER 0x0005
#define TVN_COLUMNCLICK HDN_ITEMCLICK
#define TVN_COLUMNDBLCLICK HDN_ITEMDBLCLICK
#define TVE_EXPANDRECURSIVE (0x80000000)
#define TVE_EXPANDFORCE (0x40000000)
#define TVE_EXPANDNEXT (0x20000000)
#define TVE_ALLCHILDS (0x10000000)
#define TVE_ONLYCHILDS (0x00000008)
#define TVI_SORTEX ((HTREEITEM) 0xFFFF0007)
#define TVI_BEFORE ((HTREEITEM) 0xFFFF0006)
#define TVI_AFTER ((HTREEITEM) 0xFFFF0005)
#define TVI_ROW(n) ((HTREEITEM)(0xFFE00000+(n)))
#ifndef VK_DBLCLK
#define VK_DBLCLK 0x10000 // Edit with doubleclick
#endif
#ifndef VK_ICONCLK
#define VK_ICONCLK 0x10001 // Edit with click on icon
#endif
#ifndef VK_EDITCLK
#define VK_EDITCLK 0x10002 // Edit with click on augewähltes Element //visble element ?
#endif
#ifdef UNICODE
#define TV_UINICODE 1
#else
#define TV_UINICODE 0
#endif
#define TVC_CLASSNAME "TreeList"
// Color Constants (TVM_SETBKCOLOR)
#define TVC_BK 0 // Background
#define TVC_ODD 1 // alternate colors / odd (see TVS_EX_ALTERNATECOLOR)
#define TVC_EVEN 2 // alternate colors / even (see TVS_EX_ALTERNATECOLOR)
#define TVC_FRAME 3 // separator lines (see TVS_EX_ITEMLINES)
#define TVC_TEXT 4 // text
#define TVC_LINE 5 // interior of the buttons
#define TVC_BOX 6 // exterior of the buttons
#define TVC_TRACK 7 // tracked item text
#define TVC_MARK 8 // selected line
#define TVC_MARKODD 8 // selected line (odd)
#define TVC_MARKEVEN 9 // selected line (even)
#define TVC_INSERT 10 // insertion point
#define TVC_BOXBG 11 // background of buttons
#define TVC_COLBK 12 // background of marked column
#define TVC_COLODD 13 // alternate odd color of marked column
#define TVC_COLEVEN 14 // alternate even color of marked column
#define TVC_GRAYED 15 // background when disabled
// constants for GetNextItem (TVM_GETNEXTITEM)
#define TVGN_DROPHILITESUB 0x000C // get selected column
#define TVGN_CARETSUB 0x000D // Drophighilite Spalte holen
#ifndef TVGN_NEXTSELECTED
#define TVGN_NEXTSELECTED 0x000E // next selected entry
#endif
#define TVGN_FOCUS 0x000F // entry that has focus
#define TVGN_FOCUSSUB 0x0010 // column that has focus
#define TVGN_NEXTSELCHILD 0x0011 // next selected child entry
#define TVGN_LASTCHILD 0x0012 // last child entry
#define TVGN_NEXTITEM 0x0013 // to enumerate the entries
// constants for InsertColumn (mask)
#define TVCF_FMT LVCF_FMT // set the text alignment
#define TVCF_IMAGE LVCF_IMAGE // set column image
#define TVCF_TEXT LVCF_TEXT // set column text
#define TVCF_WIDTH LVCF_WIDTH // set fixed width
#define TVCF_VWIDTH LVCF_SUBITEM // set variable width
#define TVCF_MIN LVCF_ORDER // set minimum width
#define TVCF_MARK 0x80000000 // to mark a column
#define TVCF_FIXED 0x40000000 // can the column width can be changed
#define TVCF_LASTSIZE 0x44332211 // Breite vor dem Fixieren wieder herstellen
// constants for InsertColumn (format mask)
#define TVCFMT_BITMAP_ON_RIGHT LVCFMT_BITMAP_ON_RIGHT
#define TVCFMT_COL_HAS_IMAGES LVCFMT_COL_HAS_IMAGES
#define TVCFMT_CENTER LVCFMT_CENTER
#define TVCFMT_IMAGE LVCFMT_IMAGE
#define TVCFMT_LEFT LVCFMT_LEFT
#define TVCFMT_RIGHT LVCFMT_RIGHT
#define TVCFMT_FIXED 0x20000000 // flag for fixing the column
#define TVCFMT_MARK 0x10000000 // flag for marking the column
// constants for Column AutoEdit
#define TVAE_NONE (0<<TVAE_MODEPOS) // no automatic edit
#define TVAE_EDIT (1<<TVAE_MODEPOS) // automatic edit with edit box
#define TVAE_COMBO (2<<TVAE_MODEPOS) // automatic edit with ComboBox
#define TVAE_CBLIST (3<<TVAE_MODEPOS) // automatic edit with ComboListBox
#define TVAE_STEP (4<<TVAE_MODEPOS) // advance with enter
#define TVAE_STEPED (5<<TVAE_MODEPOS) // advance with enter
#define TVAE_CHECK (6<<TVAE_MODEPOS) // automatic edit with CheckBox
#define TVAE_CHECKED (7<<TVAE_MODEPOS) // automatic edit with CheckBox and Edit
#define TVAE_NEXTLINE 0x0001 // go to next line after edit
#define TVAE_DBLCLICK 0x0002 // edit with doubleclick
#define TVAE_FULLWIDTH 0x0004 // show combobox over the full width
#define TVAE_PTRLIST 0x0008 // data list is passed as a pointer list
#define TVAE_ONLYRETURN 0x0010 // edition can only be started with Return
#define TVAE_STATEENABLE 0x0020 // edition can be (un)locked with the TVIS_DISABLEBIT flag
#define TVAE_ICONCLICK 0x0040 // edition starts by clicking on the icon
#define TVAE_DROPDOWN 0x0080 // open the DropDownList when edition starts
#define TVAE_COL(c) (((c)&0x3F)<<11) // column for automatic edit
#define TVAE_CHAR(c) (((c)&0xFF)<<17) // delimiter for the data list
#define TVAE_COUNT(c) (((c)&0x7F)<<25) // number of entries in the data list (0=auto)
#define TVAE_MODEMASK (7<<TVAE_MODEPOS) // Mask for mode bits
#define TVAE_MODEPOS 0x0008 // Mask for mode bits
#define TVIS_DISABLEBIT 0x8000 // flag for locking auto edit
// constants for HitTest (flags)
#define TVHT_SUBTOCOL(u) (((unsigned)u)>>24) // Convert column to column numbers mask
#define TVHT_SUBMASK 0xFF000000 // Maske in der die Spalte gespeichert wird
#define TVHT_ONRIGHTSPACE 0x00800000 // Auf rechtem Rand nach den Exträgen
#define TVHT_ONSUBLABEL 0x00400000 // Koordinate ist auf dem Text eines Extraeintrages
#define TVHT_ONSUBICON 0x00200000 // Koordinate ist auf einem Extraeintrag
#define TVHT_ONSUBRIGHT 0x00100000 // Koordinate ist auf einem Extraeintrag rechts vom Text
#define TVHT_ONSUBITEM (TVHT_ONSUBICON|TVHT_ONSUBLABEL)
// constants for GetItemRect (TVM_GETITEMRECT)
#define TVIR_COLTOSUB(u) ((u)<<24) // specify column
#define TVIR_GETCOLUMN 0x00000080 // get only column
#define TVIR_TEXT 0x00000001 // get only text area
// constants for SelectChilds (TVM_SELECTCHILDS)
#define TVIS_WITHCHILDS 0x00000001 // get also childs
#define TVIS_DESELECT 0x00000002 // deselect all items
// constants for Options (TVM_GETSETOPTION)
#define TVOP_AUTOEXPANDOFF 0x00000001 // Icon Offset for TVS_EX_AUTOEXPANDICON
#define TVOP_WRITEOPTION 0x80000000 // write too
// constants for EditLabel (LVM_EDITLABEL)
#define TVIR_EDITCOMBOCHAR(n) (((n)&0xFF)<<8) // Separator of the combobox entries (only for Notify message)
#define TVIR_EDITCOMBODEL 0x00000080 // Clears the buffer for the entries (only for Notify message)
#define TVIR_EDITCOMBODOWN 0x10000000 // open the combobox (only for Notify message)
#define TVIR_EDITCOMBOBOX 0x20000000 // instead of an edit, display a combobox
#define TVIR_EDITCOMBOLIST 0x40000000 // instead of an edit, display a combobox with list selection
#define TVIR_EDITFULL 0x80000000 // the edit window takes the full width
#define TVIR_EDITTEXT 0x00000001 // show the edit window over the text (only for Notify message)
#define TVIR_EDITCOL(u) ((u)&0xFF) // auto edit column
#define TVIR_SELALL 0x00000000 // select all
#define TVIR_SELAREA(a,b) ((0x0C0000|(a&0x1FF)|((b&0x1FF)<<9))<<8) // select text area
#define TVIR_SETCURSOR(a) ((0x080000|(a&0x3FFFF))<<8) // Cursor auf Textstelle
#define TVIR_SETAT(a) ((0x040000|(a&0x3FFFF))<<8) // Cursor auf Pixel-Offset
// constants for uStyleEx
#define TVS_EX_HEADEROWNIMGLIST 0x00000400 // the header has its own TVSIL_HEADER image list (else it is shared with TVSIL_NORMAL)
#define TVS_EX_HEADERCHGNOTIFY 0x00000800 // notify when a column has been resized
#define TVS_EX_HEADERDRAGDROP 0x00001000 // columns over 1 can be sorted using drag and drop
#define TVS_EX_SINGLECHECKBOX 0x00002000 // checkboxes with single selection
#define TVS_EX_STEPOUT 0x00004000 // can leave an edit control with the cursor buttons
#define TVS_EX_BITCHECKBOX 0x00008000 // change only the first bit of the state
#define TVS_EX_ITEMLINES 0x00010000 // draw the item separating lines
#define TVS_EX_ALTERNATECOLOR 0x00020000 // use alternate lines background color
#define TVS_EX_SUBSELECT 0x00040000 // allow to select columns
#define TVS_EX_FULLROWMARK 0x00080000 // the row mark fill the entire row
#define TVS_EX_TOOLTIPNOTIFY 0x00100000 // send a TVN_ITEMTOOLTIP notify to query for tooltip
#define TVS_EX_AUTOEXPANDICON 0x00200000 // use automaticaly the next icon for expanded items
#define TVS_EX_NOCHARSELCET 0x00400000 // disable looping selection of items via keyboard
#define TVS_EX_NOCOLUMNRESIZE 0x00800000 // user cannot change the columns width
#define TVS_EX_HIDEHEADERS 0x01000000 // hide the header
#define TVS_EX_GRAYEDDISABLE 0x02000000 // gray out the control when disabled
#define TVS_EX_FULLROWITEMS 0x04000000 // backgrounds and lines takes the whole line (use with TVS_EX_ALTERNATECOLOR and TVS_EX_ITEMLINES)
#define TVS_EX_FIXEDCOLSIZE 0x08000000 // the width of the whole columns stays constant when resizing columns (the right margin of last column do not change)
#define TVS_EX_HOMEENDSELECT 0x10000000 // move to first / last item with Home / End keys
#define TVS_EX_SHAREIMAGELISTS 0x20000000 // image list is not deleted when the control is destroyed
#define TVS_EX_EDITCLICK 0x40000000 // enter edit mode with a single click
#define TVS_EX_NOCURSORSET 0x80000000 // VK_EDITCLK always select the entire text. Don't set the cursor to the click point, if TVS_EX_EDITCLICK is used
#ifndef TVS_EX_MULTISELECT
#define TVS_EX_MULTISELECT 0x00000002 // allow multiple selections
#endif
#ifndef TVS_EX_AUTOHSCROLL
#define TVS_EX_AUTOHSCROLL 0x00000020 // auto scroll to selected item (horizontal scrollbar stays hidden)
#endif
// constants for notify messages
#define TVN_ITEMTOOLTIP (TVN_FIRST-32) // tooltip query
#define TVN_CBSTATECHANGED (TVN_FIRST-33) // checkbox change
#define TVN_STEPSTATECHANGED (TVN_FIRST-34) // autoedit state changed
#define TVN_STARTEDIT (TVN_FIRST-35) // field edit
#define TVN_LBUTTONUP (TVN_FIRST-36) // left button released
#define TVN_RBUTTONUP (TVN_FIRST-37) // right button released
#define TVN_COLUMNCHANGED (TVN_FIRST-38) // a column modified
// constants for new messages
#define TVM_GETHEADER (TV_FIRST+128-1)
#define TVM_GETCOLUMNCOUNT (TV_FIRST+128-2)
#define TVM_DELETECOLUMN (TV_FIRST+128-3)
#define TVM_INSERTCOLUMN (TV_FIRST+128-4-TV_UINICODE)
#define TVM_SELECTSUBITEM (TV_FIRST+128-6)
#define TVM_SELECTDROP (TV_FIRST+128-7)
#define TVM_SETITEMBKCOLOR (TV_FIRST+128-8)
#define TVM_GETITEMBKCOLOR (TV_FIRST+128-9)
#define TVM_SETITEMTEXTCOLOR (TV_FIRST+128-10)
#define TVM_GETITEMTEXTCOLOR (TV_FIRST+128-11)
#define TVM_GETITEMOFROW (TV_FIRST+128-12)
#define TVM_GETROWCOUNT (TV_FIRST+128-13)
#define TVM_GETROWOFITEM (TV_FIRST+128-14)
#define TVM_SETCOLUMN (TV_FIRST+128-15-TV_UINICODE)
#define TVM_GETCOLUMN (TV_FIRST+128-17-TV_UINICODE)
#define TVM_SETCOLUMNWIDTH (TV_FIRST+128-19)
#define TVM_GETCOLUMNWIDTH (TV_FIRST+128-20)
#define TVM_SETUSERDATASIZE (TV_FIRST+128-21)
#define TVM_GETUSERDATASIZE (TV_FIRST+128-22)
#define TVM_GETUSERDATA (TV_FIRST+128-23)
#define TVM_SORTCHILDRENEX (TV_FIRST+128-24)
#define TVM_COLUMNAUTOEDIT (TV_FIRST+128-25-TV_UINICODE)
#define TVM_COLUMNAUTOICON (TV_FIRST+128-27)
#define TVM_GETCOUNTPERPAGE (TV_FIRST+128-28)
#define TVM_FINDITEM (TV_FIRST+128-29-TV_UINICODE)
#define TVM_SELECTCHILDS (TV_FIRST+128-31)
#define TVM_GETSETOPTION (TV_FIRST+128-32)
#define TVM_ISITEMVISIBLE (TV_FIRST+128-33)
#define TVM_SETFOCUSITEM (TV_FIRST+128-34)
#define TVM_GETCOLUMNORDERARRAY (TV_FIRST+128-35)
#define TVM_SETCOLUMNORDERARRAY (TV_FIRST+128-36)
#ifndef TVM_GETITEMSTATE
#define TVM_GETITEMSTATE (TV_FIRST+39)
#endif
#ifndef TVM_GETEXTENDEDSTYLE
#define TVM_GETEXTENDEDSTYLE (TV_FIRST+45)
#endif
#ifndef TVM_SETEXTENDEDSTYLE
#define TVM_SETEXTENDEDSTYLE (TV_FIRST+44)
#endif
#ifndef TVM_GETLINECOLOR
#define TVM_GETLINECOLOR (TV_FIRST+41)
#endif
#ifndef TVM_SETLINECOLOR
#define TVM_SETLINECOLOR (TV_FIRST+40)
#endif
#ifndef TVNRET_DEFAULT
#define TVNRET_DEFAULT 0
#endif
#ifndef TVNRET_SKIPOLD
#define TVNRET_SKIPOLD 1
#endif
#ifndef TVNRET_SKIPNEW
#define TVNRET_SKIPNEW 2
#endif
#define TreeList_DeleteChildItems(h,i) ((BOOL )::SendMessage(h,TVM_DELETEITEM,0x88,(LPARAM)i))
#define TreeList_DeleteAllItems(h) ((BOOL )::SendMessage(h,TVM_DELETEITEM,0,(LPARAM)TVI_ROOT))
#define TreeList_DeleteItem(h,i) ((BOOL )::SendMessage(h,TVM_DELETEITEM,0,(LPARAM)(HTREEITEM)(i)))
#define TreeList_Expand(h,i,c) ((BOOL )::SendMessage(h,TVM_EXPAND,(WPARAM)(c),(LPARAM)(HTREEITEM)(i)))
#define TreeList_GetHeader(h) ((HWND )::SendMessage(h,TVM_GETHEADER,0,0))
#define TreeList_DeleteColumn(h,i) ((BOOL )::SendMessage(h,TVM_DELETECOLUMN,(WPARAM)(int)(i),0))
#define TreeList_InsertColumn(h,i,p) ((INT )::SendMessage(h,TVM_INSERTCOLUMN,(WPARAM)(int)(i),(LPARAM)(const TV_COLUMN*)(p)))
#define TreeList_GetColumnCount(h) ((INT )::SendMessage(h,TVM_GETCOLUMNCOUNT,0,0))
#define TreeList_HitTest(h,p) ((HTREEITEM )::SendMessage(h,TVM_HITTEST,0,(LPARAM)(LPTV_HITTESTINFO)(p)))
#define TreeList_GetItemOfRow(h,r) ((HTREEITEM )::SendMessage(h,TVM_GETITEMOFROW,0,r))
#define TreeList_GetRowOfItem(h,i) ((INT )::SendMessage(h,TVM_GETROWOFITEM,0,(LPARAM)(i)))
#define TreeList_GetRowCount(h) ((INT )::SendMessage(h,TVM_GETROWCOUNT ,0,0))
#define TreeList_GetCountPerPage(h) ((INT )::SendMessage(h,TVM_GETCOUNTPERPAGE ,0,0))
#define TreeList_GetExtendedStyle(h) ((DWORD )::SendMessage(h,TVM_GETEXTENDEDSTYLE,0,0))
#define TreeList_SetExtendedStyle(h,d) ((DWORD )::SendMessage(h,TVM_SETEXTENDEDSTYLE,0,d))
#define TreeList_SetExtendedStyleEx(h,d,m) ((DWORD )::SendMessage(h,TVM_SETEXTENDEDSTYLE,m,d))
#define TreeList_GetColor(h,i) ((COLORREF )::SendMessage(h,TVM_GETBKCOLOR,(WPARAM)(i),0))
#define TreeList_SetColor(h,i,c) ((COLORREF )::SendMessage(h,TVM_SETBKCOLOR,(WPARAM)(i),c))
#define TreeList_GetItemBkColor(h,i,s) ((COLORREF )::SendMessage(h,TVM_GETITEMBKCOLOR,(WPARAM)(i),s))
#define TreeList_SetItemBkColor(h,i,s,c) ((COLORREF )::SendMessage(h,TVM_SETITEMBKCOLOR,((UINT)(i))|((s)<<24),c))
#define TreeList_GetItemTextColor(h,i,s) ((COLORREF )::SendMessage(h,TVM_GETITEMTEXTCOLOR,(WPARAM)(i),s))
#define TreeList_SetItemTextColor(h,i,s,c) ((COLORREF )::SendMessage(h,TVM_SETITEMTEXTCOLOR,((UINT)(i))|((s)<<24),c))
#define TreeList_IsItemVisible(h,i,s) ((INT )::SendMessage(h,TVM_ISITEMVISIBLE,s,(LPARAM)(HTREEITEM)(i)))
#define TreeList_EnsureVisible(h,i) ((BOOL )::SendMessage(h,TVM_ENSUREVISIBLE,0,(LPARAM)(HTREEITEM)(i)))
#define TreeList_EnsureVisibleEx(h,i,s) ((BOOL )::SendMessage(h,TVM_ENSUREVISIBLE,s,(LPARAM)(HTREEITEM)(i)))
#define TreeList_SelectDropTargetEx(h,i,s) ((BOOL )::SendMessage(h,TVM_SELECTDROP,(WPARAM)(s),(LPARAM)(HTREEITEM)(i)))
#define TreeList_SelectSubItem(h,i,s) ((BOOL )::SendMessage(h,TVM_SELECTSUBITEM,(WPARAM)(s),(LPARAM)(HTREEITEM)(i)))
#define TreeList_SelectChilds(h,i,s) ((BOOL )::SendMessage(h,TVM_SELECTCHILDS,(WPARAM)(s),(LPARAM)(HTREEITEM)(i)))
#define TreeList_Select(h,i,c) ((BOOL )::SendMessage(h,TVM_SELECTITEM,(WPARAM)(c),(LPARAM)(HTREEITEM)(i)))
#define TreeList_EditLabel(h,i,s) ((HWND )::SendMessage(h,TVM_EDITLABEL,s,(LPARAM)(HTREEITEM)(i)))
#define TreeList_StartEdit(h,i,s) ((BOOL )::SendMessage(h,TVM_EDITLABEL,TVIR_EDITCOL(s)|TVLE_DONOTIFY,(LPARAM)(HTREEITEM)(i)))
#define TreeList_EndEditLabelNow(h,c) ((BOOL )::SendMessage(h,TVM_ENDEDITLABELNOW,c,0))
#define TreeList_GetItem(h,p) ((BOOL )::SendMessage(h,TVM_GETITEM,0,(LPARAM)(TV_ITEM*)(p)))
#define TreeList_GetCount() ((BOOL )::SendMessage(h,TVM_GETCOUNT,0,0))
#define TreeList_GetEditControl(h) ((HWND )::SendMessage(h,TVM_GETEDITCONTROL,0,0))
#define TreeList_GetImageList(h,i) ((HIMAGELIST)::SendMessage(h,TVM_GETIMAGELIST,i,0))
#define TreeList_GetUserData(h,i) ((LPVOID )::SendMessage(h,TVM_GETUSERDATA,0,(LPARAM)(HTREEITEM)(i)))
#define TreeList_GetUserDataSize(h) ((INT )::SendMessage(h,TVM_GETUSERDATASIZE,0,0))
#define TreeList_SetUserDataSize(h,s) ((INT )::SendMessage(h,TVM_SETUSERDATASIZE,0,s))
#define TreeList_GetIndent ((UINT )::SendMessage(h,TVM_GETINDENT,0,0))
#define TreeList_GetVisibleCount ((UINT )::SendMessage(h,TVM_GETVISIBLECOUNT,0,0))
#define TreeList_InsertItem(h,p) ((HTREEITEM )::SendMessage(h,TVM_INSERTITEM,0,(LPARAM)(LPTV_INSERTSTRUCT)(p)))
#define TreeList_FindItem(h,p,f) ((HTREEITEM )::SendMessage(h,TVM_FINDITEM ,(WPARAM)p,(LPARAM)f))
#define TreeList_CreateDragImage(h,i) ((HIMAGELIST)::SendMessage(h,TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(i)))
#define TreeList_CreateDragImageEx(h,i,s) ((HIMAGELIST)::SendMessage(h,TVM_CREATEDRAGIMAGE, s, (LPARAM)(HTREEITEM)(i)))
#define TreeList_SetImageList(h,l,i) ((HIMAGELIST)::SendMessage(h,TVM_SETIMAGELIST,i,(LPARAM)(UINT)(HIMAGELIST)(l)))
#define TreeList_SetIndent(h,i) ((BOOL )::SendMessage(h,TVM_SETINDENT,(WPARAM)(i),0))
#define TreeList_SetItem(h,p) ((BOOL )::SendMessage(h,TVM_SETITEM,0,(LPARAM)(const TV_ITEM*)(p)))
#define TreeList_SortChildren(h,i,r) ((BOOL )::SendMessage(h,TVM_SORTCHILDREN ,(WPARAM)r,(LPARAM)(HTREEITEM)(i)))
#define TreeList_SortChildrenCB(h,p,r) ((BOOL )::SendMessage(h,TVM_SORTCHILDRENCB,(WPARAM)r,(LPARAM)(LPTV_SORTCB)(p)))
#define TreeList_SortChildrenEX(h,p,r) ((BOOL )::SendMessage(h,TVM_SORTCHILDRENEX,(WPARAM)r,(LPARAM)(LPTV_SORTEX)(p)))
#define TreeList_SetColumn(h,i,p) ((BOOL )::SendMessage(h,TVM_SETCOLUMN,i,(LPARAM)(const TV_COLUMN*)(p)))
#define TreeList_GetColumn(h,i,p) ((BOOL )::SendMessage(h,TVM_GETCOLUMN,i,(LPARAM)(TV_COLUMN*)(p)))
#define TreeList_SetColumnWidth(h,i,w) ((BOOL )::SendMessage(h,TVM_SETCOLUMNWIDTH,i,w))
#define TreeList_GetColumnWidth(h,i) ((INT )::SendMessage(h,TVM_GETCOLUMNWIDTH,i,0))
#define TreeList_SetColumnAutoEdit(h,i,f,p) ((BOOL )::SendMessage(h,TVM_COLUMNAUTOEDIT,(WPARAM)((f)&~TVAE_COL(-1))|TVAE_COL(i),(LPARAM)(p)))
#define TreeList_SetColumnAutoIcon(h,i,n) ((BOOL )::SendMessage(h,TVM_COLUMNAUTOICON,i,n))
#define TreeList_SetFocusItem(h,i,c) ((BOOL )::SendMessage(h,TVM_SETFOCUSITEM,c,(LPARAM)(i)))
#define TreeList_SetOption(h,i,o) ((INT )::SendMessage(h,TVM_GETSETOPTION,(i)|TVOP_WRITEOPTION,(LPARAM)(o)))
#define TreeList_GetOption(h,i) ((INT )::SendMessage(h,TVM_GETSETOPTION,i,0))
#define TreeList_SetColumnOrderArray(h,n,p) ((BOOL )::SendMessage(h,TVM_SETCOLUMNORDERARRAY,n,(LPARAM)(p)))
#define TreeList_GetColumnOrderArray(h,n,p) ((BOOL )::SendMessage(h,TVM_GETCOLUMNORDERARRAY,n,(LPARAM)(p)))
#define TreeList_GetStyle(h) ((DWORD )::GetWindowLong(h,GWL_STYLE))
#define TreeList_SetStyle(h,d) ((DWORD )::SetWindowLong(h,GWL_STYLE,d))
#define TreeList_SetStyleEx(h,d,m) ((DWORD )::SetWindowLong(h,GWL_STYLE,((d)&(m))|(::GetWindowLong(h,GWL_STYLE)&~(m))))
#define TreeList_GetItemRect(h,i,s,p,c) (*(HTREEITEM*)p =(i),(BOOL)::SendMessage(h,TVM_GETITEMRECT,(WPARAM)((c)|(TVIR_COLTOSUB(s))),(LPARAM)(RECT*)(p)))
#define TreeList_SelectItem(h,i) TreeList_Select(h,i,TVGN_CARET)
#define TreeList_SelectDropTarget(h,i) TreeList_Select(h,i,TVGN_DROPHILITE)
#define TreeList_SelectSetFirstVisible(h,i) TreeList_Select(h,i,TVGN_FIRSTVISIBLE)
#define TreeList_GetNextItem(h,i,c) TreeView_GetNextItem(h, i, c)
#define TreeList_GetChild(h,i) TreeView_GetNextItem(h, i, TVGN_CHILD)
#define TreeList_GetParent(h, i) TreeView_GetNextItem(h, i, TVGN_PARENT)
#define TreeList_GetNextSibling(h,i) TreeView_GetNextItem(h, i, TVGN_NEXT)
#define TreeList_GetPrevSibling(h,i) TreeView_GetNextItem(h, i, TVGN_PREVIOUS)
#define TreeList_GetNextSelected(h,i) TreeView_GetNextItem(h, i, TVGN_NEXTSELECTED)
#define TreeList_GetNextSelectedChild(h,i) TreeView_GetNextItem(h, i, TVGN_NEXTSELCHILD)
#define TreeList_GetNextVisible(h,i) TreeView_GetNextItem(h, i, TVGN_NEXTVISIBLE)
#define TreeList_GetPrevVisible(h,i) TreeView_GetNextItem(h, i, TVGN_PREVIOUSVISIBLE)
#define TreeList_GetLastChild(h,i) TreeView_GetNextItem(h, i, TVGN_LASTCHILD)
#define TreeList_GetSelection(h) TreeView_GetNextItem(h, NULL, TVGN_CARET)
#define TreeList_GetDropHilight(h) TreeView_GetNextItem(h, NULL, TVGN_DROPHILITE)
#define TreeList_GetFirstVisible(h) TreeView_GetNextItem(h, NULL, TVGN_FIRSTVISIBLE)
#define TreeList_GetLastVisible(h) TreeView_GetNextItem(h, NULL, TVGN_LASTVISIBLE)
#define TreeList_GetRoot(h) TreeView_GetNextItem(h, NULL, TVGN_ROOT)
#define TreeList_GetFocus(h) TreeView_GetNextItem(h, NULL, TVGN_FOCUS)
#define TreeList_GetFocusColumn(h) ((int)TreeView_GetNextItem(h, NULL, TVGN_FOCUSSUB))
#define TreeList_GetSelectionColumn(h) ((int)TreeView_GetNextItem(h, NULL, TVGN_CARETSUB))
#define TreeList_GetDropHilightColumn(h) ((int)TreeView_GetNextItem(h, NULL, TVGN_DROPHILITESUB))
extern int TreeListRegister(HINSTANCE hInstance=0);
extern BOOL TreeListUnregister(HINSTANCE hInstance=0);
#endif