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