4 #define PH_TREENEW_CLASSNAME L"PhTreeNew"
6 #define PH_TREENEW_SEARCH_TIMEOUT 1000
7 #define PH_TREENEW_SEARCH_MAXIMUM_LENGTH 1023
91 #define TN_STYLE_ICONS 0x1
92 #define TN_STYLE_DOUBLE_BUFFERED 0x2
93 #define TN_STYLE_NO_DIVIDER 0x4
94 #define TN_STYLE_ANIMATE_DIVIDER 0x8
95 #define TN_STYLE_NO_COLUMN_SORT 0x10
96 #define TN_STYLE_NO_COLUMN_REORDER 0x20
97 #define TN_STYLE_THIN_ROWS 0x40
98 #define TN_STYLE_NO_COLUMN_HEADER 0x80
101 #define TN_FLAG_ITEM_DRAG_SELECT 0x1
102 #define TN_FLAG_NO_UNFOLDING_TOOLTIPS 0x2
106 #define TN_AUTO_FORECOLOR 0x1000
109 #define TN_COLUMN_CONTEXT 0x1
110 #define TN_COLUMN_TEXT 0x2
111 #define TN_COLUMN_WIDTH 0x4
112 #define TN_COLUMN_ALIGNMENT 0x8
113 #define TN_COLUMN_DISPLAYINDEX 0x10
114 #define TN_COLUMN_TEXTFLAGS 0x20
115 #define TN_COLUMN_FLAG_VISIBLE 0x100000
116 #define TN_COLUMN_FLAG_CUSTOMDRAW 0x200000
117 #define TN_COLUMN_FLAG_FIXED 0x400000
118 #define TN_COLUMN_FLAG_SORTDESCENDING 0x800000
119 #define TN_COLUMN_FLAGS 0xfff00000
122 #define TN_CACHE_COLOR 0x1
123 #define TN_CACHE_FONT 0x2
124 #define TN_CACHE_ICON 0x4
127 #define TN_MEASURE_TEXT 0x1
130 #define TN_PART_CELL 0x1
131 #define TN_PART_PLUSMINUS 0x2
132 #define TN_PART_ICON 0x4
133 #define TN_PART_CONTENT 0x8
134 #define TN_PART_TEXT 0x10
137 #define TN_TEST_COLUMN 0x1
138 #define TN_TEST_SUBITEM 0x2 // requires TN_TEST_COLUMN
141 #define TN_HIT_LEFT 0x1
142 #define TN_HIT_RIGHT 0x2
143 #define TN_HIT_ABOVE 0x4
144 #define TN_HIT_BELOW 0x8
145 #define TN_HIT_ITEM 0x10
146 #define TN_HIT_ITEM_PLUSMINUS 0x20 // requires TN_TEST_SUBITEM
147 #define TN_HIT_ITEM_ICON 0x40 // requires TN_TEST_SUBITEM
148 #define TN_HIT_ITEM_CONTENT 0x80 // requires TN_TEST_SUBITEM
149 #define TN_HIT_DIVIDER 0x100
152 #define TN_SELECT_DESELECT 0x1
153 #define TN_SELECT_TOGGLE 0x2
154 #define TN_SELECT_RESET 0x4
157 #define TN_AUTOSIZE_REMAINING_SPACE 0x1
222 _In_opt_ PVOID Parameter1,
223 _In_opt_ PVOID Parameter2,
224 _In_opt_ PVOID Context
347 #define TNM_FIRST (WM_USER + 1)
348 #define TNM_SETCALLBACK (WM_USER + 1)
349 #define TNM_NODESADDED (WM_USER + 2) // unimplemented
350 #define TNM_NODESREMOVED (WM_USER + 3) // unimplemented
351 #define TNM_NODESSTRUCTURED (WM_USER + 4)
352 #define TNM_ADDCOLUMN (WM_USER + 5)
353 #define TNM_REMOVECOLUMN (WM_USER + 6)
354 #define TNM_GETCOLUMN (WM_USER + 7)
355 #define TNM_SETCOLUMN (WM_USER + 8)
356 #define TNM_GETCOLUMNORDERARRAY (WM_USER + 9)
357 #define TNM_SETCOLUMNORDERARRAY (WM_USER + 10)
358 #define TNM_SETCURSOR (WM_USER + 11)
359 #define TNM_GETSORT (WM_USER + 12)
360 #define TNM_SETSORT (WM_USER + 13)
361 #define TNM_SETTRISTATE (WM_USER + 14)
362 #define TNM_ENSUREVISIBLE (WM_USER + 15)
363 #define TNM_SCROLL (WM_USER + 16)
364 #define TNM_GETFLATNODECOUNT (WM_USER + 17)
365 #define TNM_GETFLATNODE (WM_USER + 18)
366 #define TNM_GETCELLTEXT (WM_USER + 19)
367 #define TNM_SETNODEEXPANDED (WM_USER + 20)
368 #define TNM_GETMAXID (WM_USER + 21)
369 #define TNM_SETMAXID (WM_USER + 22)
370 #define TNM_INVALIDATENODE (WM_USER + 23)
371 #define TNM_INVALIDATENODES (WM_USER + 24)
372 #define TNM_GETFIXEDHEADER (WM_USER + 25)
373 #define TNM_GETHEADER (WM_USER + 26)
374 #define TNM_GETTOOLTIPS (WM_USER + 27)
375 #define TNM_SELECTRANGE (WM_USER + 28)
376 #define TNM_DESELECTRANGE (WM_USER + 29)
377 #define TNM_GETCOLUMNCOUNT (WM_USER + 30)
378 #define TNM_SETREDRAW (WM_USER + 31)
379 #define TNM_GETVIEWPARTS (WM_USER + 32)
380 #define TNM_GETFIXEDCOLUMN (WM_USER + 33)
381 #define TNM_GETFIRSTCOLUMN (WM_USER + 34)
382 #define TNM_SETFOCUSNODE (WM_USER + 35)
383 #define TNM_SETMARKNODE (WM_USER + 36)
384 #define TNM_SETHOTNODE (WM_USER + 37)
385 #define TNM_SETEXTENDEDFLAGS (WM_USER + 38)
386 #define TNM_GETCALLBACK (WM_USER + 39)
387 #define TNM_HITTEST (WM_USER + 40)
388 #define TNM_GETVISIBLECOLUMNCOUNT (WM_USER + 41)
389 #define TNM_AUTOSIZECOLUMN (WM_USER + 42)
390 #define TNM_SETEMPTYTEXT (WM_USER + 43)
391 #define TNM_SETROWHEIGHT (WM_USER + 44)
392 #define TNM_LAST (WM_USER + 44)
394 #define TreeNew_SetCallback(hWnd, Callback, Context) \
395 SendMessage((hWnd), TNM_SETCALLBACK, (WPARAM)(Context), (LPARAM)(Callback))
397 #define TreeNew_NodesStructured(hWnd) \
398 SendMessage((hWnd), TNM_NODESSTRUCTURED, 0, 0)
400 #define TreeNew_AddColumn(hWnd, Column) \
401 SendMessage((hWnd), TNM_ADDCOLUMN, 0, (LPARAM)(Column))
403 #define TreeNew_RemoveColumn(hWnd, Id) \
404 SendMessage((hWnd), TNM_REMOVECOLUMN, (WPARAM)(Id), 0)
406 #define TreeNew_GetColumn(hWnd, Id, Column) \
407 SendMessage((hWnd), TNM_GETCOLUMN, (WPARAM)(Id), (LPARAM)(Column))
409 #define TreeNew_SetColumn(hWnd, Mask, Column) \
410 SendMessage((hWnd), TNM_SETCOLUMN, (WPARAM)(Mask), (LPARAM)(Column))
412 #define TreeNew_GetColumnOrderArray(hWnd, Count, Array) \
413 SendMessage((hWnd), TNM_GETCOLUMNORDERARRAY, (WPARAM)(Count), (LPARAM)(Array))
415 #define TreeNew_SetColumnOrderArray(hWnd, Count, Array) \
416 SendMessage((hWnd), TNM_SETCOLUMNORDERARRAY, (WPARAM)(Count), (LPARAM)(Array))
418 #define TreeNew_SetCursor(hWnd, Cursor) \
419 SendMessage((hWnd), TNM_SETCURSOR, 0, (LPARAM)(Cursor))
421 #define TreeNew_GetSort(hWnd, Column, Order) \
422 SendMessage((hWnd), TNM_GETSORT, (WPARAM)(Column), (LPARAM)(Order))
424 #define TreeNew_SetSort(hWnd, Column, Order) \
425 SendMessage((hWnd), TNM_SETSORT, (WPARAM)(Column), (LPARAM)(Order))
427 #define TreeNew_SetTriState(hWnd, TriState) \
428 SendMessage((hWnd), TNM_SETTRISTATE, (WPARAM)(TriState), 0)
430 #define TreeNew_EnsureVisible(hWnd, Node) \
431 SendMessage((hWnd), TNM_ENSUREVISIBLE, 0, (LPARAM)(Node))
433 #define TreeNew_Scroll(hWnd, DeltaRows, DeltaX) \
434 SendMessage((hWnd), TNM_SCROLL, (WPARAM)(DeltaRows), (LPARAM)(DeltaX))
436 #define TreeNew_GetFlatNodeCount(hWnd) \
437 ((ULONG)SendMessage((hWnd), TNM_GETFLATNODECOUNT, 0, 0))
439 #define TreeNew_GetFlatNode(hWnd, Index) \
440 ((PPH_TREENEW_NODE)SendMessage((hWnd), TNM_GETFLATNODE, (WPARAM)(Index), 0))
442 #define TreeNew_GetCellText(hWnd, GetCellText) \
443 SendMessage((hWnd), TNM_GETCELLTEXT, 0, (LPARAM)(GetCellText))
445 #define TreeNew_SetNodeExpanded(hWnd, Node, Expanded) \
446 SendMessage((hWnd), TNM_SETNODEEXPANDED, (WPARAM)(Expanded), (LPARAM)(Node))
448 #define TreeNew_GetMaxId(hWnd) \
449 ((ULONG)SendMessage((hWnd), TNM_GETMAXID, 0, 0))
451 #define TreeNew_SetMaxId(hWnd, MaxId) \
452 SendMessage((hWnd), TNM_SETMAXID, (WPARAM)(MaxId), 0)
454 #define TreeNew_InvalidateNode(hWnd, Node) \
455 SendMessage((hWnd), TNM_INVALIDATENODE, 0, (LPARAM)(Node))
457 #define TreeNew_InvalidateNodes(hWnd, Start, End) \
458 SendMessage((hWnd), TNM_INVALIDATENODES, (WPARAM)(Start), (LPARAM)(End))
460 #define TreeNew_GetFixedHeader(hWnd) \
461 ((HWND)SendMessage((hWnd), TNM_GETFIXEDHEADER, 0, 0))
463 #define TreeNew_GetHeader(hWnd) \
464 ((HWND)SendMessage((hWnd), TNM_GETHEADER, 0, 0))
466 #define TreeNew_GetTooltips(hWnd) \
467 ((HWND)SendMessage((hWnd), TNM_GETTOOLTIPS, 0, 0))
469 #define TreeNew_SelectRange(hWnd, Start, End) \
470 SendMessage((hWnd), TNM_SELECTRANGE, (WPARAM)(Start), (LPARAM)(End))
472 #define TreeNew_DeselectRange(hWnd, Start, End) \
473 SendMessage((hWnd), TNM_DESELECTRANGE, (WPARAM)(Start), (LPARAM)(End))
475 #define TreeNew_GetColumnCount(hWnd) \
476 ((ULONG)SendMessage((hWnd), TNM_GETCOLUMNCOUNT, 0, 0))
478 #define TreeNew_SetRedraw(hWnd, Redraw) \
479 ((LONG)SendMessage((hWnd), TNM_SETREDRAW, (WPARAM)(Redraw), 0))
481 #define TreeNew_GetViewParts(hWnd, Parts) \
482 SendMessage((hWnd), TNM_GETVIEWPARTS, 0, (LPARAM)(Parts))
484 #define TreeNew_GetFixedColumn(hWnd) \
485 ((PPH_TREENEW_COLUMN)SendMessage((hWnd), TNM_GETFIXEDCOLUMN, 0, 0))
487 #define TreeNew_GetFirstColumn(hWnd) \
488 ((PPH_TREENEW_COLUMN)SendMessage((hWnd), TNM_GETFIRSTCOLUMN, 0, 0))
490 #define TreeNew_SetFocusNode(hWnd, Node) \
491 SendMessage((hWnd), TNM_SETFOCUSNODE, 0, (LPARAM)(Node))
493 #define TreeNew_SetMarkNode(hWnd, Node) \
494 SendMessage((hWnd), TNM_SETMARKNODE, 0, (LPARAM)(Node))
496 #define TreeNew_SetHotNode(hWnd, Node) \
497 SendMessage((hWnd), TNM_SETHOTNODE, 0, (LPARAM)(Node))
499 #define TreeNew_SetExtendedFlags(hWnd, Mask, Value) \
500 SendMessage((hWnd), TNM_SETEXTENDEDFLAGS, (WPARAM)(Mask), (LPARAM)(Value))
502 #define TreeNew_GetCallback(hWnd, Callback, Context) \
503 SendMessage((hWnd), TNM_GETCALLBACK, (WPARAM)(Context), (LPARAM)(Callback))
505 #define TreeNew_HitTest(hWnd, HitTest) \
506 SendMessage((hWnd), TNM_HITTEST, 0, (LPARAM)(HitTest))
508 #define TreeNew_GetVisibleColumnCount(hWnd) \
509 ((ULONG)SendMessage((hWnd), TNM_GETVISIBLECOLUMNCOUNT, 0, 0))
511 #define TreeNew_AutoSizeColumn(hWnd, Id, Flags) \
512 SendMessage((hWnd), TNM_AUTOSIZECOLUMN, (WPARAM)(Id), (LPARAM)(Flags))
514 #define TreeNew_SetEmptyText(hWnd, Text, Flags) \
515 SendMessage((hWnd), TNM_SETEMPTYTEXT, (WPARAM)(Flags), (LPARAM)(Text))
517 #define TreeNew_SetRowHeight(hWnd, RowHeight) \
518 SendMessage((hWnd), TNM_SETROWHEIGHT, (WPARAM)(RowHeight), 0)
539 _In_ PPH_TREENEW_NODE Node
544 Node->Visible =
TRUE;
545 Node->Expanded =
TRUE;
549 _Inout_ PPH_TREENEW_NODE Node,
554 Node->s.CachedColorValid =
FALSE;
556 Node->s.CachedFontValid =
FALSE;
558 Node->s.CachedIconValid =
FALSE;
564 _In_ BOOLEAN Visible,
567 _In_ ULONG Alignment,
568 _In_ ULONG DisplayIndex,
578 column.
Width = Width;
583 if (DisplayIndex == -2)
592 _In_ BOOLEAN Visible,
595 _In_ ULONG Alignment,
596 _In_ ULONG DisplayIndex,
597 _In_ ULONG TextFlags,
598 _In_ BOOLEAN SortDescending
607 column.
Width = Width;
612 if (DisplayIndex == -2)
623 _In_ BOOLEAN Visible,
626 _In_ ULONG Alignment,
627 _In_ ULONG DisplayIndex,
628 _In_ ULONG TextFlags,
629 _In_ ULONG ExtraFlags
638 column.
Width = Width;
643 if (DisplayIndex == -2)