# SftTree/DLL 8.0 — API Reference > Complete A-Z reference for SftTree/DLL 8.0. The guide and feature documentation is in https://softelvdm.com/Vault/Softelvdm.com/llms/SftTree-DLL-8.0.txt Online documentation: https://softelvdm.com/Documentation/SftTree%20DLL%208%200 ## Notifications *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications* The parent window of a tree control can receive the following event notifications using the WM_COMMAND message. For information on the WM_COMMAND message, please see the Windows API documentation. WM_COMMAND: ``` NotifyCode = HIWORD(wParam); idItem = LOWORD(wParam); hwndCtl = (HWND) lParam; ``` ### Notification Codes | | | --- | | General Notifications | | Cell Editing Notifications | | Drag & Drop Notifications | | Left Mouse Button Notifications | | Middle Mouse Button Notifications | | Right Mouse Button Notifications | The [SftTree/DLL Wizard](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_wizard) can be used to look at notifications as they occur by clicking on the "Events" tab. ### General Notifications | ***NotifyCode*** | ***Description*** | | --- | --- | | SFTTREEN_AUTOEXPANDING | The item described by [GetExpandCollapseIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapseindex) needs to be expanded because of the current [SetAutoExpand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpand) settings or a recent call to [StartAutoExpandTimer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_startautoexpandtimer). | | SFTTREEN_CARETCHANGE | The caret location has changed. The caret location describes the current item which receives the focus rectangle when the tree control has the input focus (see [GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex)). The current item is not necessarily the same as the currently selected item (see [GetCurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel)). The [SFTTREESTYLE_NOTIFY](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) style has to be defined to receive this notification. | | SFTTREEN_COLUMNSIZE | The user resized a column or the [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) has been moved. [GetResizeColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizecolumn) can be used to determine the column being resized. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_COLUMNSIZEENDED | The user resized a column or the splitter bar has been moved and the [column resizing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_resizing) operation has ended (the user released the left mouse button). | | SFTTREEN_COLUMNSIZESTARTED | The user is about to resize a column or the splitter bar is about to be moved. The user has pressed the left mouse button on the column resizing area. GetResizeColumn can be used to determine the column being resized. | | SFTTREEN_CONTEXTMENU | The right mouse button was clicked on the tree control. This notification can be used to implement context menus. Use the Windows GetCursorPos API to determine the cursor position. Before displaying a [context menu](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_contextmenu), an application should always send a WM_CANCELMODE message to the tree control. | | SFTTREEN_DARKMODE_CHANGED | The active [dark mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_darkmode) state flipped. This notification is sent when [SetDarkMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_darkmode) is SFTTREE_DARKMODE_AUTO and the Windows "Choose your mode" setting changes, or when SetDarkMode programmatically switches modes. Use IsDarkModeActive to read the current state. | | SFTTREEN_DPI_CHANGED | The monitor DPI changed. This notification is sent to Per-Monitor v2 DPI-aware hosts when the tree control's window moves to a monitor of a different DPI, or the system DPI changes. Use [GetDPI](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dpi) to read the new value. The application should re-send WM_SETFONT with a font sized for the new DPI; caller-supplied [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) images should be re-registered at the new physical size unless [SetImageScaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_imagescaling) is SFTTREE_IMAGESCALING_STRETCH. | | SFTTREEN_EXPANDALL | The user has pressed the numeric keypad's "*" key to expand the current item so all its [dependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) are shown. Use GetCaretIndex to retrieve the current item index. | | SFTTREEN_FLYBYHIGHLIGHT | The item highlighted by [flyby highlighting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_flyby_highlighting) has changed. Use [GetFlybyIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_flybyindex) to retrieve to index of the current target item of flyby highlighting. | | SFTTREEN_HIGHCONTRAST_CHANGED | The [Windows High Contrast](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_highcontrast) [accessibility](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_accessibility) state flipped. This notification is sent when [SetHighContrastMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_highcontrast) is SFTTREE_HIGHCONTRAST_AUTO and the user toggles the system High Contrast setting. Use IsHighContrastActive to read the current state. | | SFTTREEN_KEYINTERCEPTED | A key stroke for a child window has been intercepted during [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). Key strokes to be intercepted are defined using [SetKeyHandling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_keyhandling). The intercepted key can be retrieved using the GetKeyHandling function. | | SFTTREEN_KILLFOCUS | The tree control lost the input focus. | | SFTTREEN_MOUSEENTER | The mouse cursor entered the tree control window. | | SFTTREEN_MOUSELEAVE | The mouse cursor left the tree control window. | | SFTTREEN_MOUSEMOVE | The tree control received a WM_MOUSEMOVE message. Use the Windows API GetCursorPos to retrieve the cursor location. | | SFTTREEN_OFFSETCHANGE | The [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling) offset has changed. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. While processing this notification, no tree control and item attributes should be altered. | | SFTTREEN_OVERHEADCHANGED | Due to the variable number of levels and the resulting hierarchical display, the width of the first column is always treated as a minimum width. The text portion of the first column will always be at least the width specified using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns), no matter what level the item is on. This can result in the first column being much wider than the defined width. If more levels are added to a hierarchy, the value returned by [GetOverheadWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_overheadwidth) increases. When the overhead width changes, this notification is sent to the tree control's parent window. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_REORDERED | The user has reordered the [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns). All [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) buttons are returned to their "up" position. | | SFTTREEN_SELCANCEL | The user canceled a selection. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_SELCHANGE | The user has changed the current selection. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_SETFOCUS | The tree control received the input focus. | | SFTTREEN_TOPCHANGE | The first item displayed by the control has changed. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_VK_RETURN | The Return key was pressed while the tree control had the input focus. An application can implement a custom response to this notification. A SFTTREEN_LBUTTONDBLCLK_TEXT notification immediately follows the SFTTREEN_VK_RETURN notification. If an application handles the SFTTREEN_VK_RETURN notification, the application should send a WM_CANCELMODE message to the tree control to suppress the SFTTREEN_LBUTTONDBLCLK_TEXT notification. | ### Cell Editing Notifications | ***NotifyCode*** | ***Description*** | | --- | --- | | SFTTREEN_QUITEDIT | This notification is used to notify the tree control's parent window that any editing of tree [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) should be abandoned now. No data validation should take place and no modifications should be made to the tree control. This notification is only sent if the tree control currently has a child window. The tree control generates this notification when the size or position of the child window is changing, when modifications to the tree control occur or when a menu or menu selection is about to become active. The parent window should destroy all controls associated with cell editing. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_VALIDATEEDIT | If a cell is being edited, the parent window should now validate the data entered. The parent window can display an error message and then set the input focus back to the control used for cell editing. In this case, the event that caused input validation to occur, is ignored. If the [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) accepts the input data, the child control(s) should now be destroyed, the tree control updated and the input focus set to the tree control. If the child control is not destroyed, the tree control assumes that input validation failed and cell editing continues. This notification is only sent if the tree control currently has a child window. The tree control generates this notification when the user moves away from the child control using the mouse buttons. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | ### Drag & Drop Notifications | ***NotifyCode*** | ***Description*** | | --- | --- | | SFTTREEN_BEGINDRAG | The user is starting to drag one or several items. All items currently selected participate in the drag operation. An application can set the mouse cursor in response to this event or cancel the drag operation. The drag operation can be aborted by sending a WM_CANCELMODE message to the tree control or by clearing all currently selected items. The drag operation is described by the [SFTTREE_DRAGINFO](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_draginfo) structure. The SFTTREESTYLE_DRAGDROP style has to be defined to receive this notification. | | SFTTREEN_CANCELDRAG | The user canceled the drag operation. The SFTTREESTYLE_DRAGDROP style has to be defined to receive this notification. | | SFTTREEN_DRAGGING | The user is moving the mouse cursor to drag one or several items. All items currently selected participate in the drag operation. The drag operation is described by the SFTTREE_DRAGINFO structure. An application can set the mouse cursor in response to this event. The SFTTREESTYLE_DRAGDROP style has to be defined to receive this notification. | | SFTTREEN_ENDDRAG | The user released the mouse button. All items currently selected participate in the drag operation. The drag operation is described by the SFTTREE_DRAGINFO structure. An application should process the dropped items in response to this event. The SFTTREESTYLE_DRAGDROP style has to be defined to receive this notification. | ### Left Mouse Button Notifications | ***NotifyCode*** | ***Description*** | | --- | --- | | SFTTREEN_LBUTTONDBLCLK_BUTTON | The left mouse button was double-clicked on the [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) of the current entry (caret location). Use GetExpandCollapseIndex to determine the item index where the mouse button was clicked. Use [Expand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expand) and [Collapse](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_collapse) to expand/collapse the item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_CELL | The left mouse button was double-clicked on a cell, but not on the [cell picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap). Use GetCaretIndex and [GetCaretColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretcolumn) to retrieve the cell location. If the mouse button is double-clicked on the cell picture, SFTTREEN_LBUTTONDBLCLK_CELLBMP is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_CELLBMP | The left mouse button was double-clicked on a cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is double-clicked on the cell, but not on the cell picture, SFTTREEN_LBUTTONDBLCLK_CELL is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_COLUMN | Provided for compatibility with older versions - use SFTTREEN_LBUTTONDBLCLK_COLUMN_HEADER instead. | | SFTTREEN_LBUTTONDBLCLK_COLUMN_FOOTER | The left mouse button was double-clicked on the [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers). Use [GetFooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerbutton) to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_COLUMN_FOOTERDD | The left mouse button was double-clicked on the column [footer dropdown/filter button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dropdown). Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_COLUMN_HEADER | The left mouse button was double-clicked on the column header. Use [GetHeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerbutton) to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_COLUMNRES | The left mouse button was double-clicked at the right edge of the column header or the splitter bar. Usually this notification is used to optimally resize a column using [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal). Use GetResizeColumn to determine the column number of the header. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_ITEM | The left mouse button was double-clicked on the [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_LABEL | The left mouse button was double-clicked on the [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap) of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_PLUSMIN | The left mouse button was double-clicked on the [plus/minus bitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_plusminus_bitmap) of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_ROW | The left mouse button was double-clicked on the [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_ROWCOLUMN | Provided for compatibility with older versions - use SFTTREEN_LBUTTONDBLCLK_ROWCOLUMN_HEADER instead. | | SFTTREEN_LBUTTONDBLCLK_ROWCOLUMN_FOOTER | The left mouse button was double-clicked on the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer). Use the [SetRowColFooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterbutton) function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_ROWCOLUMN_HEADER | The left mouse button was double-clicked on the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). Use the [SetRowColHeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderbutton) function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDBLCLK_TEXT | The left mouse button was double-clicked on the cells of the current entry (caret location) or the Return key was pressed. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. This notification is always sent for the Return key. Instead of using this notification, SFTTREEN_LBUTTONDBLCLK_CELL and SFTTREEN_LBUTTONDBLCLK_CELLBMP can also be used. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification for mouse button clicks. | | SFTTREEN_LBUTTONDBLCLK_TREE | The left mouse button was double-clicked in the area of the current entry (caret location) where the connecting [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines) are drawn. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_BUTTON | The left mouse button was clicked on the expand/collapse button of the current entry (caret location), the left arrow key was clicked on an expanded parent item or the right arrow key was clicked on a collapsed parent item. Use GetExpandCollapseIndex to determine the item index. Expand and Collapse can be used to expand/collapse the item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_CELL | The left mouse button was clicked on a cell, but not on the cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is clicked on the cell picture, SFTTREEN_LBUTTONDOWN_CELLBMP is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_CELLBMP | The left mouse button was clicked on a cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is clicked on the cell, but not on the cell picture, SFTTREEN_LBUTTONDOWN_CELL is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_COLUMN | Provided for compatibility with older versions - use SFTTREEN_LBUTTONDOWN_COLUMN_HEADER instead. | | SFTTREEN_LBUTTONDOWN_COLUMN_FOOTER | The left mouse button was clicked on the column footer. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_COLUMN_FOOTERDD | The left mouse button was clicked on the column footer dropdown/filter button. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_COLUMN_HEADER | The left mouse button was clicked on the column header. Use GetHeaderButton to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_COLUMN_HEADERDD | The left mouse button was clicked on the column header dropdown/filter button. Use GetHeaderButton to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_ITEM | The left mouse button was clicked on the item picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_LABEL | The left mouse button was clicked on the label picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_PLUSMIN | The left mouse button was clicked on the plus/minus bitmap of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_ROW | The left mouse button was clicked on the row header of the current item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_ROWCOLUMN | Provided for compatibility with older versions - use SFTTREEN_LBUTTONDOWN_ROWCOLUMN_HEADER instead. | | SFTTREEN_LBUTTONDOWN_ROWCOLUMN_FOOTER | The left mouse button was clicked on the row/column footer. Use the SetRowColFooterButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_ROWCOLUMN_HEADER | The left mouse button was clicked on the row/column header. Use the SetRowColHeaderButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_TEXT | The left mouse button was clicked on the cells (any column) of the current entry (caret location). Use GetCaretIndex and GetCaretColumn to retrieve the cell location. Instead of using this notification, SFTTREEN_LBUTTONDOWN_CELL and SFTTREEN_LBUTTONDOWN_CELLBMP can also be used. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | | SFTTREEN_LBUTTONDOWN_TEXTAGAIN | The left mouse button was clicked on a cell (any column) of an already selected item. The notification is only generated if there is a sufficiently long pause between the first click to select the item and the second click. If the pause is not long enough, the SFTTREEN_LBUTTONDBLCLK_TEXT notification is generated instead. Use [GetClickAgainPos](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_clickagainpos) to determine the index and column number where the click occurred. | | SFTTREEN_LBUTTONDOWN_TREE | The left mouse button was clicked in the area of the current entry (caret location) where the connecting tree lines are drawn. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. | ### Middle Mouse Button Notifications | ***NotifyCode*** | ***Description*** | | --- | --- | | SFTTREEN_MBUTTONDBLCLK_BUTTON | The middle mouse button was double-clicked on the expand/collapse button of the current entry (caret location). Use GetExpandCollapseIndex to determine the item index where the mouse button was clicked. Use Expand and Collapse to expand/collapse the item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_CELL | The middle mouse button was double-clicked on a cell, but not on the cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is double-clicked on the cell picture, SFTTREEN_MBUTTONDBLCLK_CELLBMP is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_CELLBMP | The middle mouse button was double-clicked on a cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is double-clicked on the cell, but not on the cell picture, SFTTREEN_MBUTTONDBLCLK_CELL is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_COLUMN | Provided for compatibility with older versions - use SFTTREEN_MBUTTONDBLCLK_COLUMN_HEADER instead. | | SFTTREEN_MBUTTONDBLCLK_COLUMN_FOOTER | The middle mouse button was double-clicked on the column footer. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_COLUMN_FOOTERDD | The middle mouse button was double-clicked on the column footer dropdown/filter button. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_COLUMN_HEADER | The middle mouse button was double-clicked on the column header. Use GetHeaderButton to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_COLUMNRES | The middle mouse button was double-clicked at the right edge of the column header. Usually this notification is used to optimally resize a column using MakeColumnOptimal. Use GetResizeColumn to determine the column number of the header. This notification is not generated for a splitter bar. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_ITEM | The middle mouse button was double-clicked on the item picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_LABEL | The middle mouse button was double-clicked on the label picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_PLUSMIN | The middle mouse button was double-clicked on the plus/minus bitmap of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_ROW | The middle mouse button was double-clicked on the row header of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_ROWCOLUMN | Provided for compatibility with older versions - use SFTTREEN_MBUTTONDBLCLK_ROWCOLUMN_HEADER instead. | | SFTTREEN_MBUTTONDBLCLK_ROWCOLUMN_FOOTER | The middle mouse button was double-clicked on the row/column footer. Use the SetRowColFooterButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_ROWCOLUMN_HEADER | The middle mouse button was double-clicked on the row/column header. Use the SetRowColHeaderButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_TEXT | The middle mouse button was double-clicked on the cells of the current entry (caret location) or the Return key was pressed. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. Instead of using this notification, SFTTREEN_MBUTTONDBLCLK_CELL and SFTTREEN_MBUTTONDBLCLK_CELLBMP can also be used. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDBLCLK_TREE | The middle mouse button was double-clicked in the area of the current entry (caret location) where the connecting tree lines are drawn. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_BUTTON | The middle mouse button was clicked on the expand/collapse button of the current entry (caret location). Use GetExpandCollapseIndex to determine the item index where the mouse button was clicked. Use Expand and Collapse to expand/collapse the item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_CELL | The middle mouse button was clicked on a cell, but not on the cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is clicked on the cell picture, SFTTREEN_MBUTTONDOWN_CELLBMP is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_CELLBMP | The middle mouse button was clicked on a cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is clicked on the cell, but not on the cell picture, SFTTREEN_MBUTTONDOWN_CELL is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_COLUMN | Provided for compatibility with older versions - use SFTTREEN_MBUTTONDOWN_COLUMN_HEADER instead. | | SFTTREEN_MBUTTONDOWN_COLUMN_FOOTER | The middle mouse button was clicked on the column footer. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_COLUMN_FOOTERDD | The middle mouse button was clicked on the column footer dropdown/filter button. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_COLUMN_HEADER | The middle mouse button was clicked on the column header. Use GetHeaderButton to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_COLUMN_HEADERDD | The middle mouse button was clicked on the column header dropdown/filter button. Use GetHeaderButton to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_ITEM | The middle mouse button was clicked on the item picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_LABEL | The middle mouse button was clicked on the label picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_PLUSMIN | The middle mouse button was clicked on the plus/minus bitmap of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_ROW | The middle mouse button was clicked on the row header of the current item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_ROWCOLUMN | Provided for compatibility with older versions - use SFTTREEN_MBUTTONDOWN_ROWCOLUMN_HEADER instead. | | SFTTREEN_MBUTTONDOWN_ROWCOLUMN_FOOTER | The middle mouse button was clicked on the row/column footer. Use the SetRowColFooterButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_ROWCOLUMN_HEADER | The middle mouse button was clicked on the row/column header. Use the SetRowColHeaderButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_TEXT | The middle mouse button was clicked on the cells (any column) of the current entry (caret location). Use GetCaretIndex and GetCaretColumn to retrieve the cell location. Instead of using this notification, SFTTREEN_MBUTTONDOWN_CELL and SFTTREEN_MBUTTONDOWN_CELLBMP can also be used. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_TEXTAGAIN | The middle mouse button was clicked on a cell (any column) of an already selected item. The notification is only generated if there is a sufficiently long pause between the first click to select the item and the second click. If the pause is not long enough, the SFTTREEN_MBUTTONDBLCLK_TEXT notification is generated instead. Use GetClickAgainPos to determine the index and column number where the click occurred. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_MBUTTONDOWN_TREE | The middle mouse button was clicked in the area of the current entry (caret location) where the connecting tree lines are drawn. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | ### Right Mouse Button Notifications | ***NotifyCode*** | ***Description*** | | --- | --- | | SFTTREEN_RBUTTONDBLCLK_BUTTON | The right mouse button was double-clicked on the expand/collapse button of the current entry (caret location). Use GetExpandCollapseIndex to determine the item index where the mouse button was clicked. Use Expand and Collapse to expand/collapse the item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_CELL | The right mouse button was double-clicked on a cell, but not on the cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is double-clicked on the cell picture, SFTTREEN_RBUTTONDBLCLK_CELLBMP is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_CELLBMP | The right mouse button was double-clicked on a cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is double-clicked on the cell, but not on the cell picture, SFTTREEN_RBUTTONDBLCLK_CELL is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_COLUMN | Provided for compatibility with older versions - use SFTTREEN_RBUTTONDBLCLK_COLUMN_HEADER instead. | | SFTTREEN_RBUTTONDBLCLK_COLUMN_FOOTER | The right mouse button was double-clicked on the column footer. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_COLUMN_FOOTERDD | The right mouse button was double-clicked on the column footer dropdown/filter button. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_COLUMN_HEADER | The right mouse button was double-clicked on the column header. Use GetHeaderButton to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_COLUMNRES | The right mouse button was double-clicked at the right edge of the column header. Usually this notification is used to optimally resize a column using MakeColumnOptimal. Use GetResizeColumn to determine the column number of the header. This notification is not generated for a splitter bar. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_ITEM | The right mouse button was double-clicked on the item picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_LABEL | The right mouse button was double-clicked on the label picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_PLUSMIN | The right mouse button was double-clicked on the plus/minus bitmap of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_ROW | The right mouse button was double-clicked on the row header of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_ROWCOLUMN | Provided for compatibility with older versions - use SFTTREEN_RBUTTONDBLCLK_ROWCOLUMN_HEADER instead. | | SFTTREEN_RBUTTONDBLCLK_ROWCOLUMN_FOOTER | The right mouse button was double-clicked on the row/column footer. Use the SetRowColFooterButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_ROWCOLUMN_HEADER | The right mouse button was double-clicked on the row/column header. Use the SetRowColHeaderButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_TEXT | The right mouse button was double-clicked on the cells of the current entry (caret location) or the Return key was pressed. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. Instead of using this notification, SFTTREEN_RBUTTONDBLCLK_CELL and SFTTREEN_RBUTTONDBLCLK_CELLBMP can also be used. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDBLCLK_TREE | The right mouse button was double-clicked in the area of the current entry (caret location) where the connecting tree lines are drawn. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_BUTTON | The right mouse button was clicked on the expand/collapse button of the current entry (caret location). Use GetExpandCollapseIndex to determine the item index where the mouse button was clicked. Use Expand and Collapse to expand/collapse the item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_CELL | The right mouse button was clicked on a cell, but not on the cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is clicked on the cell picture, SFTTREEN_RBUTTONDOWN_CELLBMP is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_CELLBMP | The right mouse button was clicked on a cell picture. Use GetCaretIndex and GetCaretColumn to retrieve the cell location. If the mouse button is clicked on the cell, but not on the cell picture, SFTTREEN_RBUTTONDOWN_CELL is received instead. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_COLUMN | Provided for compatibility with older versions - use SFTTREEN_RBUTTONDOWN_COLUMN_HEADER instead. | | SFTTREEN_RBUTTONDOWN_COLUMN_FOOTER | The right mouse button was clicked on the column footer. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_COLUMN_FOOTERDD | The right mouse button was clicked on the column footer dropdown/filter button. Use GetFooterButton to determine the footer button pressed and use SetFooterButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_COLUMN_HEADER | The right mouse button was clicked on the column header. Use GetHeaderButton to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_COLUMN_HEADERDD | The right mouse button was clicked on the column header dropdown/filter button. Use GetHeaderButton to determine the header button pressed and use SetHeaderButton to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_ITEM | The right mouse button was clicked on the item picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_LABEL | The right mouse button was clicked on the label picture of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_PLUSMIN | The right mouse button was clicked on the plus/minus bitmap of the current entry (caret location). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_ROW | The right mouse button was clicked on the row header of the current item. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_ROWCOLUMN | Provided for compatibility with older versions - use SFTTREEN_RBUTTONDOWN_ROWCOLUMN_HEADER instead. | | SFTTREEN_RBUTTONDOWN_ROWCOLUMN_FOOTER | The right mouse button was clicked on the row/column footer. Use the SetRowColFooterButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_ROWCOLUMN_HEADER | The right mouse button was clicked on the row/column header. Use the SetRowColHeaderButton function to reset the button (if desired). The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_TEXT | The right mouse button was clicked on the cells (any column) of the current entry (caret location). Use GetCaretIndex and GetCaretColumn to retrieve the cell location. Instead of using this notification, SFTTREEN_RBUTTONDOWN_CELL and SFTTREEN_RBUTTONDOWN_CELLBMP can also be used. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_TEXTAGAIN | The right mouse button was clicked on a cell (any column) of an already selected item. The notification is only generated if there is a sufficiently long pause between the first click to select the item and the second click. If the pause is not long enough, the SFTTREEN_RBUTTONDBLCLK_TEXT notification is generated instead. Use GetClickAgainPos to determine the index and column number where the click occurred. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | | SFTTREEN_RBUTTONDOWN_TREE | The right mouse button was clicked in the area of the current entry (caret location) where the connecting tree lines are drawn. The SFTTREESTYLE_NOTIFY style has to be defined to receive this notification. This notification is not generated if the tree control has the SFTTREESTYLE_LEFTBUTTONONLY style. | See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) ## Window Styles *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles* The following window styles are available in addition to the standard window styles (such as WS_BORDER, WS_TABSTOP, etc.): ### SFTTREESTYLE_DISABLENOSCROLL (0x0001L) When this style is selected, the scroll bars are disabled when scrolling is not possible. Without this style, scroll bars are hidden when scrolling is not possible. This style should not be changed after the tree control is created. Use [SetDisableNoScroll](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_disablenoscroll) instead. ### SFTTREESTYLE_DRAGDROP (0x0010L) When this style is selected, the tree control allows the user to [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) items within and outside the tree control. It is up to the control's [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) to handle the [notification](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) messages to process a drag & drop operation and to set appropriate mouse cursors. This style can be changed using SetWindowLong(hwnd, GWL_STYLE, style), as long as no drag & drop operation is in progress. ### SFTTREESTYLE_LEFTBUTTONONLY (0x0020L) When this style is selected, the tree control will ignore the middle and right mouse buttons. No notifications will be sent to the parent window when the middle or right mouse buttons are clicked. ### SFTTREESTYLE_MULTIPLESEL (0x0008L) When this style is selected, the tree control will allow multiple items to be selected at the same time. One or more items can be selected using the mouse. Using the Control key causes additional items to be selected without removing previous [selections](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections). Using the Shift key causes ranges of items to be selected, starting at the last position. Without this style, only one item can be selected at a time and the Control and Shift keys have no effect. This style can be changed using SetWindowLong(hwnd, GWL_STYLE, style), however all selections have to be cleared first. ### SFTTREESTYLE_NOTIFY (0x0004L) When this style is selected, the tree control will send WM_COMMAND messages to the parent window for event notification. This style can be changed using SetWindowLong(hwnd, GWL_STYLE, style). ### SFTTREESTYLE_SCROLL (0x0040L) When this style is selected, the window styles WS_HSCROLL and WS_VSCROLL given when the tree control is created, determine if scroll bars are present. If this style is not selected, scroll bars are automatically added to the tree control when needed. E.g., to prevent a vertical scroll bar from being added to the tree control, define the SFTTREESTYLE_SCROLL style and do not add the WS_VSCROLL style. ### SFTTREESTYLE_VARIABLE (0x0080L) Defines a [variable height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, where the height of each item varies based on the fonts, bitmaps, pictures, lines of text, word wrapping and other attributes used. In a variable height tree control each item can have a different height based on its attributes. If this style is not specified, all items have the same height. ### SFTTREESTYLE_WANTKEYBOARDINPUT (0x0002L) When this style is selected, the tree control will send [WM_VKEYTOITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windows_messages) messages to the parent window for keyboard input processing. Without this style, the parent window will not receive WM_VKEYTOITEM messages from the tree control. This style can be changed using SetWindowLong(hwnd, GWL_STYLE, style). This notification is only sent for keystrokes received by the tree control through the WM_KEYDOWN message and is provided for compatibility with the standard Windows list box. Applications should handle the WM_CHAR or WM_KEYDOWN messages instead to enhance or expand the tree control response to keyboard input. This can be accomplished by subclassing the control (C) or by deriving a C++ class from the provided tree control classes ([CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) or CSftTreeSplit). See Also C/C++ API | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## Extended Window Styles *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles_ext* The following extended window styles are honored by SftTree/DLL, in addition to the standard extended window styles (such as WS_EX_TOOLWINDOW, etc.): ### WS_EX_LEFTSCROLLBAR When this extended style is given, the vertical scroll bar will be displayed on the left side of the tree control client area, instead of the right. This style is only supported on certain international Windows versions, such as Hebrew and Arabic Windows. ### WS_EX_RIGHT When this extended style is given, the tree control will support right-to-left reading with the tree hierarchy displayed on the right hand side of the control as typically found in Hebrew and Arabic Windows versions. ### WS_EX_CLIENTEDGE With this extended style, the tree control will be drawn using a 3D border. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Windows Messages *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windows_messages* ### WM_CONTEXTMENU The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button in the tree control. ### Parameters hwnd = (HWND) wParam; Window handle of the tree control. xPos = LOWORD(lParam); Horizontal position of the cursor, in screen coordinates, at the time of the mouse click. yPos = HIWORD(lParam); Vertical position of the cursor, in screen coordinates, at the time of the mouse click. ### Comments A window can process this message by displaying a [context menu](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_contextmenu) using the TrackPopupMenu or TrackPopupMenuEx function. > Before displaying a context menu, an application should always send a WM_CANCELMODE message to the tree control. ### WM_CTLCOLORLISTBOX While a standard tree control generates the WM_CTLCOLORLISTBOX which can be handled by the parent window, SftTree/DLL offers a simple API function to define tree colors (see [SetCtlColors](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors)). WM_CTLCOLORLISTBOX messages are generated by the tree control for compatibility with SftTree 1.0 only. When developing new applications, please use SetCtlColors instead. ### WM_VKEYTOITEM The WM_VKEYTOITEM message is sent by a tree control with the [SFTTREESTYLE_WANTKEYBOARDINPUT](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) style to its [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) in response to a WM_KEYDOWN message. ### Parameters wVkey = LOWORD(wParam) The virtual-key code of the key that the user pressed. hwnd = (HWND) lParam Window handle of the tree control. nCaretPos = HIWORD(wParam) Caret location (if more than 32K items are added to the tree control, use [GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex) to retrieve a valid caret location). ### Returns The return value specifies the action that the application performed in response to the message. A return value of 2 indicates that the application handled all aspects of selecting the item and requires no further action by the tree control. A return value of 1 indicates that the tree control should perform the default action in response to the keystroke. A return value of 0 or greater specifies the zero-based index of an item in the tree control and indicates that the tree control should perform the default action for the keystroke on the given item. ### Comments A tree control will only support WM_VKEYTOITEM messages if its window style includes the SFTTREESTYLE_WANTKEYBOARDINPUT style. The WM_VKEYTOITEM message is only generated for keystrokes that are normally handled by the tree control, such as the arrow keys. If other keys need to be processed, the tree control must be subclassed instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## C/C++ API (By Category) *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories* Direct calls to the SftTree DLLs are used to communicate with the tree control for maximum efficiency. The class [CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) defines all necessary functions to communicate with the tree control. The class CSftTreeSplit defines a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). The API Reference section lists C and C++ macros and functions. They are sorted alphabetically, but leading *SftTree_*, *SftTree_Get* and *SftTree_Set* text is not considered. E.g., when looking up the function *[SftTree_GetCurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel)*, look for topic *CurSel*, the leading *SftTree_Get* is dropped. The following function groups are listed in detail: | | | | --- | --- | | Accessibility | [Dark mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_darkmode), [High Contrast](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_highcontrast) and screen-reader announcements | | Application | Application initialization and termination | | Attributes | General tree control attributes | | Callback Routines | Application-defined callback routines | | Columns, Column Headers and Footers | Column and [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers)/[column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) attributes | | Current Item, Selection | The currently selected item | | DPI and Scaling | [Per-Monitor DPI](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dpi) awareness and image / pixel scaling | | Drag & Drop | [Drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) support functions | | Item Attributes | Item and [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) attributes | | Item Hit Testing | Hit testing | | Items | Item manipulation | | Positioning & Resizing | Item positioning and resizing | | Relationships | Retrieving [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent)/child relationship information | | Row/Column Footer | [Row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) attributes | | Row/Column Header | [Row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) attributes | | Row Header | [Row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) attributes | | Scrolling | Scrolling manipulation | | Sorting | [Sorting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents) items | | Split Tree Control | Split tree control and splitter bar manipulation | | Virtual Mode | Using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) | ### Accessibility | | | | --- | --- | | [Announce](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_announce) | Pushes short application-status text to attached [screen readers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_accessibility) through a UI Automation [notification](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) event. | | [DarkMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_darkmode) | Defines whether the tree control is rendered using a dark color palette. | | [HighContrastMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_highcontrast) | Defines whether the tree control honors the Windows High Contrast accessibility setting. | ### Application | | | | --- | --- | | [RegisterApp](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_registerapp) | Registers an application with SftTree/DLL. | | [UnregisterApp](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_unregisterapp) | Unregisters an application from SftTree/DLL. | | [FreeGDIPlusImageLoadedFromFile](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_freegdiplusimageloadedfromfile) | Deletes a [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) image obtained using [SftTree_LoadGDIPlusImageFromFile](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_loadgdiplusimagefromfile). | | [FreeGDIPlusImageLoadedFromResource](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_freegdiplusimageloadedfromresource) | Deletes a GDI+ image obtained using [SftTree_LoadGDIPlusImageFromResource](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_loadgdiplusimagefromresource). | | LoadGDIPlusImageFromFile | Loads a GDI+ image from a file. | | LoadGDIPlusImageFromResource | Loads a GDI+ image from an application's or DLL's resources. | ### Attributes | | | | --- | --- | | [~CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_csfttreedes) | Standard destructor. | | [~CSftTreeSplit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_csfttreesplitdes) | Standard destructor. | | [AutoExpand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpand) | Defines whether items are automatically expanded when the mouse hovers over a collapsed parent item. | | [AutoExpandItem](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpanditem) | Returns the zero-based index of the item to be expanded as a result of a call to [StartAutoExpandTimer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_startautoexpandtimer) or SetAutoExpand. | | [BackgroundBitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_backgroundbitmap) | Defines a background bitmap used as the background for the tree control. | | [Bitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_bitmaps) | Registers the size and sets the default [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) used for all items. | | [Buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_buttons) | Registers the size and sets the bitmaps used for [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons). | | [CalcLimit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calclimit) | Defines the maximum number of items to consider for optimal column width and scrolling calculation. | | [CalcVisibleOnly](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcvisibleonly) | Defines whether only visible items are considered for optimal column width and scrolling calculation. | | [CharSearchMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_charsearchmode) | Defines the method used to search for matching items in response to characters typed by the user. | | [ControlData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controldata) | Defines an application-defined value. | | [ControlInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controlinfo) | Defines the tree control's attributes. | | [Create](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_create) | Creates a tree control window and attaches it to the CSftTree or CSftTreeSplit object. | | CSftTree | Standard constructor. | | CSftTreeSplit | Standard constructor. | | [CtlColors](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors) | Defines the tree control's color attributes. | | [CustomCode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_customcode) | Defines optional product customization. | | [Flyby](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_flyby) | Defines whether [flyby highlighting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_flyby_highlighting) is enabled. | | [FlybyIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_flybyindex) | Returs the index of the highlighted item for flyby highlighting. | | [ForwardChildMsgs](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_forwardchildmsgs) | Defines the child window message handling status. | | [GridStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_gridstyle) | Defines the grid line display style. | | [Indentation](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_indentation) | Defines the indentation (in pixels) for item levels. | | [InheritBgColor](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_inheritbgcolor) | Defines whether the area to the left of the first cell inherits the cell's background color. | | [ItemLines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlines) | Defines the number of text lines used for item height calculation. | | [ItemsShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemsshown) | Returns the number of items displayable in the tree control's client area, including partial items. | | [ItemsShownComplete](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemsshowncomplete) | Returns the number of items displayable in the tree control's client area, not including partial items. | | [KeyHandling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_keyhandling) | Defines keystrokes intercepted during [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). | | [NoFocusStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nofocusstyle) | Defines the display style of selected items when the tree control does not have the input focus. | | [Pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures) | Registers the size and sets the default item pictures used for all items. | | [PlusMinus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_plusminus) | Defines the [plus/minus bitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_plusminus_bitmap) used for all items. | | [ScrollTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_scrolltips) | Defines whether ScrollTips are displayed during vertical scrolling. | | [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) | Used to describe a picture component (a bitmap, icon or ImageList image, etc.). | | [SFTTREE_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_class) | Defines the window class name of a tree control without splitter bar. | | [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors) | Used with GetCtlColors and SetCtlColors to retrieve and set a tree control's color attributes. | | [SFTTREE_CONTROL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control) | Used with GetControlInfo and SetControlInfo to retrieve and set tree control attributes. | | [SFTTREE_DWORD_PTR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_dword_ptr) | Defines a type large enough to hold a DWORD or pointer value. | | [SFTTREE_ID](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_id) | Defines the type of an item ID. | | [SFTTREE_MAXLEVELS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_maxlevels) | Defines the maximum number of levels supported. | | [SFTTREE_NOCOLOR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor) | Used to indicate that the default color should be used. | | [SFTTREE_OBSOLETE_4](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_obsolete_4) | Used to indicate compatibility with SftTree/DLL 4.0 (and older). | | [SFTTREESPLIT_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttreesplit_class) | Defines the window class name of a tree control with splitter bar. | | [Show3D](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_show3d) | Defines the current display method used for items. | | [ShowBitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbitmaps) | Returns a value indicating the presence of item pictures. | | [ShowButton0](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbutton0) | Defines the presence of level 0 expand/collapse buttons. | | [ShowButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbuttons) | Defines the presence of expand/collapse buttons (other than level 0). | | [ShowGrid](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showgrid) | Defines the presence of [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines). | | [ShowLabels](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showlabels) | Returns the presence of [label pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap). | | [ShowPlusMinus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showplusminus) | Returns the presence of plus/minus bitmaps. | | [ShowTruncated](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showtruncated) | Defines whether text is clipped or truncated using trailing "...". | | [TabKeyIntercept](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tabkeyintercept) | Defines the status of Tab key handling during cell editing. | | [ToolTipAlways](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipalways) | Defines whether [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) are shown even if [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) is not truncated. | | [ToolTipsUseEntireCell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipsuseentirecell) | Defines whether ToolTips use the entire cell. | | [TreeLineStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_treelinestyle) | Defines the display style of [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines). | | [UpdateCaretExpandCollapse](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_updatecaretexpandcollapse) | Defines whether the current location (caret) is updated when the expand/collapse buttons are used. | | [UseSmoothScroll](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_usesmoothscroll) | Defines whether smooth scrolling is used. | | [UseThemes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_usethemes) | Defines whether the control can use [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes). | | [VAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_valign) | Defines the vertical alignment of tree lines, label pictures, plus/minus bitmap and item pictures. | ### Callback Routines | | | | --- | --- | | [DeleteCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletecallback) | Defines a deletion callback routine, called when items are deleted. | | [LPFNSFTTREE_OWNERDRAWPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_ownerdrawproc) | Defines the type of an application-supplied owner-draw function, which is called whenever an object needs to be rendered. | | [OwnerDrawCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback) | Defines an application-supplied owner-draw function, which is called whenever an object needs to be rendered. | | [SFTTREE_DELETEPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_deleteparm) | Used to define an application-specific deletion callback routine, which is called whenever an item is removed from the tree control. | | [SFTTREE_DELETEPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_deleteproc) | Defines the type of a user-supplied callback routine, called by SftTree/DLL whenever an item is removed from the tree control. | | [SFTTREE_OWNERDRAW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdraw) | Used as parameter for an application-supplied owner-draw function of type LPFNSFTTREE_OWNERDRAWPROC. | | [SFTTREE_OWNERDRAWPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdrawparm) | Used to define an application-specific owner-draw callback routine, which is called whenever an object needs to be rendered. | | [SFTTREE_TOOLTIPSPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_tooltipsparm) | Used as parameter for [SetToolTipsCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipscallback), to define an application-specific ToolTips callback routine, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. | | [SFTTREE_TOOLTIPSPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_tooltipsproc) | Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to define the ToolTip text when a ToolTip or ScrollTip is to be displayed. | | ToolTipsCallback | Defines an application supplied callback function, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. | ### Columns, Column Headers and Footers | | | | --- | --- | | [Columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) | Defines the number of columns and column attributes. | | [CrossColumnResize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_crosscolumnresize) | Defines whether multiple columns can be resized during one [column resizing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_resizing) operation. | | [DisplayColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycolumn) | Returns the [display column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) given a real column number. | | [DisplayFooterDropDownRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayfooterdropdownrect) | Returns the dimensions of the column [footer dropdown/filter button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dropdown). | | [DisplayFooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayfooterrect) | Returns the dimensions of the column footer area. | | [DisplayHeaderDropDownRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayheaderdropdownrect) | Returns the dimensions of the column header dropdown/filter button. | | [DisplayHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayheaderrect) | Returns the dimensions of the column header area. | | [FirstDisplayColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_firstdisplaycolumn) | Returns the index of the first displayed column. | | [Footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footer) | Defines a column's footer text. | | [FooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerbutton) | Defines the column number of the currently pressed column footer button. | | [FooterFont](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerfont) | Defines the font used for column footer text display. | | [FooterLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerlength) | Returns the length of a column's footer text. | | [FooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerrect) | Returns the dimensions of the column footer area. | | [Header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_header) | Defines a column's header text. | | [HeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerbutton) | Defines the column number of the currently pressed column header button. | | [HeaderFont](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerfont) | Defines the font used for column header text display. | | [HeaderLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerlength) | Returns the length of a column's header text. | | [HeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerrect) | Returns the dimensions of the column header area. | | [LastDisplayColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_lastdisplaycolumn) | Returns the index of the last displayed column. | | [MultilineFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilinefooter) | Defines whether column footers can display multiple lines of text. | | [MultilineHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilineheader) | Defines whether column headers can display multiple lines of text. | | [OpenEnded](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_openended) | Defines whether the last column is open-ended. | | [OverheadWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_overheadwidth) | Returns the width of the area added to the first column for hierarchical graphics components. | | [RealColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_realcolumn) | Returns the real column number given a display column number. | | [ReorderColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_reordercolumns) | Defines whether columns can be reordered using [column drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_drag_drop). | | [ResizeColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizecolumn) | Returns the column number of the column being resized. | | [ResizeFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizefooter) | Defines whether column footers are resizable by the user. | | [ResizeHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizeheader) | Defines whether column headers are resizable by the user. | | [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) | Used with [GetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) and SetColumns to retrieve and set column attributes. | | [ShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter) | Defines the presence of column footers. | | [ShowFooterButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooterbuttons) | Defines the presence of column footers buttons. | | [ShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader) | Defines the presence of column headers. | | [ShowHeaderButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheaderbuttons) | Defines the presence of column header buttons. | ### Current Item, Selection | | | | --- | --- | | [CaretColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretcolumn) | Returns the column where a mouse button was last clicked. | | [CaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex) | Defines the current item (caret location). | | [ClickAgainPos](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_clickagainpos) | Returns the location of the item that was clicked again. | | CurSel | Defines the index of the selected item ([single selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree control). | | [DrawSelectionOutline](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drawselectionoutline) | Draws a selection outline. | | [RubberbandSelection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rubberbandselection) | Defines whether click-drag selection of multiple items using a selection rectangle is supported. | | [Sel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sel) | Defines the selection status of an item (multiple selection tree only). | | [SelCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selcount) | Returns the number of currently selected items (multiple selection tree only). | | [SelectionArea](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionarea) | Defines the area where selection changes occur. | | [SelectionStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle) | Defines the display style of selected items. | | [SelectString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectstring) | Searches a string and selects the matching item. | | [SelectStringExact](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectstringexact) | Searches a string and selects the matching item. | | [SelItemRange](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemrange) | Selects or deselects a range of items (multiple selection tree only). | | [SelItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitems) | Fills an array with the index numbers of currently selected items. | | [SelItemsArray](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemsarray) | Returns an array of [SFTTREE_SELENTRY](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_selentry) structures describing groups of selected items. | | SFTTREE_SELENTRY | Used by GetSelItemsArray to return an array of structures describing groups of selected items. | | [ShowFocus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfocus) | Defines whether a focus rectangle is drawn around the current item when the tree control has the input focus. | ### DPI and Scaling | | | | --- | --- | | DPI | Returns the effective DPI for the monitor the tree control is currently displayed on. | | [ImageScaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_imagescaling) | Defines how images drawn by the tree control are scaled relative to the current monitor DPI. | | [PixelScaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pixelscaling) | Defines how caller-supplied pixel dimensions are interpreted relative to the current monitor DPI. | ### Drag & Drop | | | | --- | --- | | [DragBitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragbitmaps) | Defines the drag & drop starting location attribute. | | [DragImage](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragimage) | Returns a drag image representing the currently selected items. | | [DragInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_draginfo) | Returns drag & drop operation information in a [SFTTREE_DRAGINFO](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_draginfo) structure. | | [DragType](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragtype) | Defines the drag & drop detection attribute. | | [DropHighlight](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlight) | Defines the current drag & drop target location. | | [DropHighlightStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlightstyle) | Defines the display attribute of the current drag & drop target item. | | SFTTREE_DRAGINFO | Used during drag & drop operations and can be retrieved using GetDragInfo. | | StartAutoExpandTimer | Starts a timer for the specified item, so a SFTTREEN_AUTOEXPANDING notification will be sent. | | [StopAutoExpandTimer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_stopautoexpandtimer) | Ends a started SFTTREEN_AUTOEXPANDING notification timer. | ### Item Attributes | | | | --- | --- | | [AdjustCellEditRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_adjustcelleditrect) | Returns a cell's location in client area coordinates of the left or right pane of a split tree control. | | [CellEditWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_celleditwindow) | Returns the window containing the specified cell in a split tree control. | | [CellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo) | Defines a cell's attributes. | | [CellRectInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellrectinfo) | Returns the location of a cell, the cell text and [cell picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap). | | [CellRectInfoEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellrectinfoex) | Returns the location of a cell, the cell text and cell picture. | | [DisplayCellRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect) | Returns the location of a cell. | | [DisplayCellRectForItem](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrectforitem) | Returns the location of a cell. | | [ExpandCollapseButtonRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapsebuttonrect) | Returns the location of an item's expand/collapse button. | | [ExpandCollapseIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapseindex) | Returns the zero-based index of the item to expand/collapse. | | [ItemBitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itembitmap) | Defines an item's item picture. | | [ItemBitmapAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itembitmapalign) | Defines whether item pictures of items are aligned with the cells of the immediate parent level. | | [ItemData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata) | Defines an item's application-specific value. | | [ItemEditIgnore](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemeditignore) | Defines whether an item is ignored for cell editing. | | [ItemExpand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpand) | Defines an item's [expand status](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_expandstatus). | | [ItemExpandable](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandable) | Defines whether an item is expandable. | | [ItemExpandCollapseButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandcollapsebutton) | Defines whether an item's expand/collapse button is shown. | | [ItemHeight](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheight) | Returns an item's height (in pixels). | | [ItemHeightMinMax](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheightminmax) | Defines an item's minimum and maximum height (in pixels). | | [ItemID](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemid) | Defines an item's ID. | | [ItemIgnore](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemignore) | Defines whether the item is excluded from optimal column width and row header width calculation. | | [ItemIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemindex) | Returns an item's index given an item ID. | | [ItemLabel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabel) | Defines an item's label picture information. | | [ItemLabelPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabelpicture) | Defines an item's label picture information. | | [ItemLevel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel) | Defines an item's level number. | | [ItemPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicture) | Defines an item's item picture. | | [ItemPictureAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicturealign) | Defines whether item pictures of items are aligned with the cells of the immediate parent level. | | [ItemRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemrect) | Returns an item's location in client area coordinates. | | [ItemShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemshown) | Defines an item's [visibility status](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_visibilitystatus). | | [ItemStatus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemstatus) | Defines an item's enabled/disabled status. | | [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) | Used with GetCellInfo/SetCellInfo to retrieve and set cell attributes and as part of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure (for a virtual data source). | | [SFTTREE_CELLINFOPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cellinfoparm) | Used as parameter for GetCellInfo and SetCellInfo to retrieve and set cell attributes. | | [Text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text) | Defines an item's cell text. | | [TextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_textlength) | Returns the length of an item's cell text. | ### Item Hit Testing | | | | --- | --- | | [CalcCellFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccellfrompoint) | Calculates the item index and column number given a point in tree control client area coordinates. | | [CalcColumnFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccolumnfrompoint) | Calculates the column number given a point in tree control client area coordinates. | | [CalcIndexFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcindexfrompoint) | Calculates the item index number given a point in tree control client area coordinates. | ### Items | | | | --- | --- | | [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) | Adds a new item to a tree control. The new item is added as the last item at level 0. | | [Collapse](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_collapse) | Collapses a parent item. | | [CopyItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_copyitems) | Copies a group of items to a new location. | | [DeleteDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletedependents) | Deletes an item's [dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) items. | | [DeleteString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletestring) | Deletes an item. | | [Expand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expand) | Expands a parent item. | | [FindItem](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_finditem) | Searches item data. | | [FindString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstring) | Searches a string. | | [FindStringEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringex) | Searches cells for a string. | | [FindStringExact](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringexact) | Searches a string. | | [Count](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_count) | Returns the number of items in the tree control. | | [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring) | Inserts a new item using a string. | | [MoveItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_moveitems) | Moves a group of items to a new position in the tree control. | | [ResetContent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resetcontent) | Removes all items from the tree control. | ### Positioning & Resizing | | | | --- | --- | | [CalcOptimalCellDimensions](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcelldimensions) | Calculates a cell's optimal height and width so its contents aren't truncated. | | [CalcOptimalColumnWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth) | Calculates a column's optimal width so text and pictures are not clipped. | | [CalcOptimalRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalrowheaderwidth) | Calculates the optimal width for row headers so text and pictures are not clipped. | | [TopIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_topindex) | Defines the index number of the item shown at the top of the tree control. | | [MakeCellVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecellvisible) | Scrolls the specified cell into view horizontally and vertically so that it is displayed in the tree control's client area. | | [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal) | Sets the optimal column width so that the text and pictures of all items can be displayed without being clipped horizontally. | | [MakeColumnVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnvisible) | Scrolls the specified column into view horizontally so that it is displayed in the tree control's client area. | | [MakeIntegralHeight](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makeintegralheight) | Resizes the tree control vertically so visible items are displayed in their entirety. | | [MakeRowHeaderOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowheaderoptimal) | Sets the optimal row header width so that the text and pictures of all row headers can be displayed. | | [MakeRowVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowvisible) | Scrolls the specified item into view vertically so that it is displayed in the tree control's client area. | | [SizeBox](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sizebox) | Defines whether a size box is shown in the tree control's lower-right corner so the user can resize the control by dragging it. | ### Relationships | | | | --- | --- | | [Dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependent) | Returns dependent item information for a parent item. | | [DependentCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependentcount) | Returns the number of dependents for a parent item. | | [NextShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nextshown) | Returns the next visible item. | | [Parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_parent) | Returns an item's parent index. | | [PrevShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_prevshown) | Returns the previous visible item. | | [Sibling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sibling) | Returns an item's [sibling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_siblings) information. | | [TopParent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_topparent) | Returns the highest level parent index number for an item. | ### Row/Column Footer | | | | --- | --- | | [RowColFooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterbutton) | Defines whether the row/column footer button is currently down (pressed). | | [RowColFooterPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterpicture) | Defines the picture displayed in the row/column footer. | | [RowColFooterPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterpicturestyle) | Defines the position of the picture displayed in the row/column footer. | | [RowColFooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterrect) | Returns the dimensions of the row/column footer area. | | [RowColFooterStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterstyle) | Defines the position of the text displayed in the row/column footer. | | [RowColFooterText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfootertext) | Defines the row/column footer text. | | [RowColFooterTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfootertextlength) | Returns the row/column footer text length. | | [ShowRowColFooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowcolfooterbutton) | Defines the row/column footer's display style. | ### Row/Column Header | | | | --- | --- | | [RowColBitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmap) | Defines the picture displayed in the row/column header. | | [RowColBitmapStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmapstyle) | Defines the position of the picture displayed in the row/column header. | | [RowColHeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderbutton) | Defines whether the row/column header button is currently down (pressed). | | [RowColHeaderPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicture) | Defines the picture displayed in the row/column header. | | [RowColHeaderPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicturestyle) | Defines the position of the picture displayed in the row/column header. | | [RowColHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderrect) | Returns the dimensions of the row/column header area. | | [RowColHeaderStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderstyle) | Defines the position of the text displayed in the row/column header. | | [RowColHeaderText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertext) | Defines the row/column header text. | | [RowColHeaderTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertextlength) | Returns the row/column header text length. | | [RowColPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolpicture) | Defines the picture displayed in the row/column header. | | [RowColPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolpicturestyle) | Defines the position of the picture displayed in the row/column header. | | [RowColText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcoltext) | Defines the row/column header text. | | [RowColTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcoltextlength) | Returns the row/column header text length. | | [ShowRowColHeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowcolheaderbutton) | Defines the row/column header's display style. | ### Row Header | | | | --- | --- | | [RowHeaderFont](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderfont) | Defines the font used for row header text display. | | [RowHeaderLines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderlines) | Defines the number of text lines used for row header height calculation. | | [RowHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderrect) | Returns the dimensions of the row header area. | | [RowHeaderStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderstyle) | Defines the position of text displayed in the row headers. | | [RowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderwidth) | Defines the width of the row header area. | | [RowInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowinfo) | Defines an item's row header attributes. | | [RowText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtext) | Defines an item's row header text. | | [RowTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtextlength) | Returns an item's row header text length. | | [SFTTREE_ROW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_row) | Used with GetRowInfo and SetRowInfo and as part of the SFTTREE_ITEM structure (for a virtual data source). | | [SFTTREE_ROWINFOPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_rowinfoparm) | Used as parameter for GetRowInfo and SetRowInfo to retrieve and set row header attributes. | | [ShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) | Defines the row header display style. | ### Scrolling | | | | --- | --- | | [DisableNoScroll](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_disablenoscroll) | Defines the scroll bar handling status. | | [HorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontalextent) | Defines the horizontal extent (in pixels) of the displayable area. | | [HorizontalOffset](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontaloffset) | Defines the current horizontal offset (in pixels) of the displayed area. | | [RecalcHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_recalchorizontalextent) | Recalculates the optimal [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling) extent. | ### Sorting | | | | --- | --- | | [EnableSortIndicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enablesortindicators) | Enables [sort indicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_sortindicator) in column headers. | | [ResetSortIndicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resetsortindicators) | Removes all sort indicators from all columns. | | [SFTTREE_SORTPROC_CELLDATA](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc_celldata) | Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents. | | [SFTTREE_SORTPROC_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc_item) | Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents. | | [SFTTREE_SORTPROCEX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortprocex) | Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents. | | [SortColumn1](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortcolumn1) | Returns information about the currently sorted column. | | SortDependents | Sorts items. | ### Split Tree Control | | | | --- | --- | | [EnterResizeMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enterresizemode) | Allows the user to resize the panes of a split tree control using the keyboard. | | [LeftWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_leftwindow) | Returns the window handle or object of the tree control in the left pane of a split tree control. | | [MakeSplitterOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makesplitteroptimal) | Positions the splitter bar optimally, so the left pane can display as much data as possible without a horizontal scroll bar. | | [RightWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rightwindow) | Returns the window handle or object of the tree control in the right pane of a split tree control. | | [SplitColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitcolumn) | Defines the number of columns displayed in the left pane of a split tree control. | | [SplitterOffset](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffset) | Defines the offset of the splitter bar relative to the left edge of the tree control's client area. | | [SplitterOffsetMin](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffsetmin) | Defines a minimum splitter bar offset to prevent the user from hiding the left pane of a split tree control. | | [SplitterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterrect) | Returns the location of the splitter bar in client area coordinates. | | [SplitterWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterwidth) | Defines the width of the splitter bar in a split tree control. | ### Virtual Mode | | | | --- | --- | | [LPFNSFTTREE_VGETITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_vgetitem) | Defines the type of the virtual data source callback used by SftTree/DLL to retrieve information about one item as it is needed by the tree control. | | [LPFNSFTTREE_VRELEASEITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_vreleaseitem) | Defines the type of the virtual data source callback called by SftTree/DLL to release information previously returned by the SFTTREE_VGETITEM callback. | | [MakeContentWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecontentwindow) | Defines the specified window as a [content window](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_contentwindows) ([virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode) only). | | SFTTREE_ITEM | Used by the callback function SFTTREE_VGETITEM to return the requested item information to SftTree/DLL when a virtual data source is used. | | [SFTTREE_VIRTUALDEF](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_virtualdef) | Used by [VirtualInitialize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualinitialize) to use the tree control in virtual mode and to define the virtual data source. | | [VirtualCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualcount) | Defines the number of items when using a virtual data source. | | VirtualInitialize | Initializes a tree control for virtual mode and for use with a virtual data source. | | [VirtualItemChanged](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualitemchanged) | Notifies a tree control using a virtual data source that items have been changed. | | [VirtualUserData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualuserdata) | Returns the application defined value last used in the SFTTREE_VIRTUALDEF structure when VirtualInitialize was called. | See Also C/C++ API | Notifications ## C/C++ API *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api* Direct calls to the SftTree DLLs are used to communicate with the tree control for maximum efficiency. The class CSftTree defines all necessary functions to communicate with the tree control. The class CSftTreeSplit defines a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). The API Reference section lists C and C++ macros and functions. They are sorted alphabetically, but leading *SftTree_*, *SftTree_Get* and *SftTree_Set* text is not considered. E.g., when looking up the function *[SftTree_GetCurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel)*, look for topic *CurSel*, the leading *SftTree_Get* is dropped. ### Definitions and Structures | Name | Description | | --- | --- | | [LPFNSFTTREE_OWNERDRAWPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_ownerdrawproc) | Defines the type of an application-supplied owner-draw function, which is called whenever an object needs to be rendered. | | [LPFNSFTTREE_VGETITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_vgetitem) | Defines the type of the [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) callback used by SftTree/DLL to retrieve information about one item as it is needed by the tree control. | | [LPFNSFTTREE_VRELEASEITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_vreleaseitem) | Defines the type of the virtual data source callback called by SftTree/DLL to release information previously returned by the SFTTREE_VGETITEM callback. | | [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) | Used to describe a picture component (a bitmap, icon or ImageList image, etc.). | | [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) | Used with [GetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo)/SetCellInfo to retrieve and set [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) attributes and as part of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure (for a virtual data source). | | [SFTTREE_CELLINFOPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cellinfoparm) | Used as parameter for GetCellInfo and SetCellInfo to retrieve and set cell attributes. | | [SFTTREE_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_class) | Defines the window class name of a tree control without splitter bar. | | [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors) | Used with [GetCtlColors](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors) and SetCtlColors to retrieve and set a tree control's color attributes. | | [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) | Used with [GetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) and SetColumns to retrieve and set column attributes. | | [SFTTREE_CONTROL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control) | Used with [GetControlInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controlinfo) and SetControlInfo to retrieve and set tree control attributes. | | [SFTTREE_DELETEPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_deleteparm) | Used to define an application-specific deletion callback routine, which is called whenever an item is removed from the tree control. | | [SFTTREE_DELETEPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_deleteproc) | Defines the type of a user-supplied callback routine, called by SftTree/DLL whenever an item is removed from the tree control. | | [SFTTREE_DRAGINFO](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_draginfo) | Used during [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) operations and can be retrieved using [GetDragInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_draginfo). | | [SFTTREE_DWORD_PTR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_dword_ptr) | Defines a type large enough to hold a DWORD or pointer value. | | [SFTTREE_ID](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_id) | Defines the type of an item ID. | | SFTTREE_ITEM | Used by the callback function SFTTREE_VGETITEM to return the requested item information to SftTree/DLL when a virtual data source is used. | | [SFTTREE_MAXLEVELS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_maxlevels) | Defines the maximum number of levels supported. | | [SFTTREE_NOCOLOR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor) | Used to indicate that the default color should be used. | | [SFTTREE_OBSOLETE_4](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_obsolete_4) | Used to indicate compatibility with SftTree/DLL 4.0 (and older). | | [SFTTREE_OWNERDRAW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdraw) | Used as parameter for an application-supplied owner-draw function of type LPFNSFTTREE_OWNERDRAWPROC. | | [SFTTREE_OWNERDRAWPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdrawparm) | Used to define an application-specific owner-draw callback routine, which is called whenever an object needs to be rendered. | | [SFTTREE_ROW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_row) | Used with [GetRowInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowinfo) and SetRowInfo and as part of the SFTTREE_ITEM structure (for a virtual data source). | | [SFTTREE_ROWINFOPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_rowinfoparm) | Used as parameter for GetRowInfo and SetRowInfo to retrieve and set [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) attributes. | | [SFTTREE_SELENTRY](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_selentry) | Used by [GetSelItemsArray](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemsarray) to return an array of structures describing groups of selected items. | | [SFTTREE_SORTPROC_CELLDATA](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc_celldata) | Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using [SortDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents). | | [SFTTREE_SORTPROC_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc_item) | Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents. | | [SFTTREE_SORTPROCEX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortprocex) | Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents. | | [SFTTREE_STATIC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_static) | Defines static [linking](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_buildingapp) of SftTree/DLL to an application. | | [SFTTREE_TOOLTIPSPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_tooltipsparm) | Used as parameter for [SetToolTipsCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipscallback), to define an application-specific [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) callback routine, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. | | [SFTTREE_TOOLTIPSPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_tooltipsproc) | Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to define the ToolTip text when a ToolTip or ScrollTip is to be displayed. | | [SFTTREE_VIRTUALDEF](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_virtualdef) | Used by [VirtualInitialize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualinitialize) to use the tree control in [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode) and to define the virtual data source. | | [SFTTREESPLIT_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttreesplit_class) | Defines the window class name of a tree control with splitter bar. | ### Functions | Name | Description | | --- | --- | | [~CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_csfttreedes) | Standard destructor. | | [~CSftTreeSplit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_csfttreesplitdes) | Standard destructor. | | [AccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn) | Defines the current column accessed by column specific functions. | | [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) | Adds a new item to a tree control. The new item is added as the last item at level 0. | | [AdjustCellEditRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_adjustcelleditrect) | Returns a cell's location in client area coordinates of the left or right pane of a split tree control. | | [Announce](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_announce) | Pushes short application-status text to attached [screen readers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_accessibility) through a UI Automation [notification](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) event. | | [AutoExpand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpand) | Defines whether items are automatically expanded when the mouse hovers over a collapsed [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent). | | [AutoExpandItem](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpanditem) | Returns the zero-based index of the item to be expanded as a result of a call to [StartAutoExpandTimer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_startautoexpandtimer) or SetAutoExpand. | | [BackgroundBitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_backgroundbitmap) | Defines a background bitmap used as the background for the tree control. | | [Bitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_bitmaps) | Registers the size and sets the default [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) used for all items. | | [Buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_buttons) | Registers the size and sets the bitmaps used for [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons). | | [CalcCellFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccellfrompoint) | Calculates the item index and column number given a point in tree control client area coordinates. | | [CalcColumnFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccolumnfrompoint) | Calculates the column number given a point in tree control client area coordinates. | | [CalcIndexFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcindexfrompoint) | Calculates the item index number given a point in tree control client area coordinates. | | [CalcLimit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calclimit) | Defines the maximum number of items to consider for optimal column width and scrolling calculation. | | [CalcOptimalColumnWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth) | Calculates a column's optimal width so text and pictures are not clipped. | | [CalcOptimalCellDimensions](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcelldimensions) | Calculates a cell's optimal height and width so its contents aren't truncated. | | [CalcOptimalRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalrowheaderwidth) | Calculates the optimal width for row headers so text and pictures are not clipped. | | [CalcVisibleOnly](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcvisibleonly) | Defines whether only visible items are considered for optimal column width and scrolling calculation. | | [CaretColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretcolumn) | Returns the column where a mouse button was last clicked. | | [CaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex) | Defines the current item (caret location). | | [CellEditWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_celleditwindow) | Returns the window containing the specified cell in a split tree control. | | CellInfo | Defines a cell's attributes. | | [CellRectInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellrectinfo) | Returns the location of a cell, the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) and [cell picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap). | | [CellRectInfoEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellrectinfoex) | Returns the location of a cell, the cell text and cell picture. | | [CharSearchMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_charsearchmode) | Defines the method used to search for matching items in response to characters typed by the user. | | [ClickAgainPos](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_clickagainpos) | Returns the location of the item that was clicked again. | | [Collapse](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_collapse) | Collapses a parent item. | | ColumnsEx | Defines the number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) and column attributes. | | [ControlData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controldata) | Defines an application-defined value. | | ControlInfo | Defines the tree control's attributes. | | [CopyItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_copyitems) | Copies a group of items to a new location. | | [Count](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_count) | Returns the number of items in the tree control. | | [Create](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_create) | Creates a tree control window and attaches it to the CSftTree or CSftTreeSplit object. | | [CrossColumnResize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_crosscolumnresize) | Defines whether multiple columns can be resized during one [column resizing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_resizing) operation. | | CSftTree | Standard constructor. | | CSftTreeSplit | Standard constructor. | | CtlColors | Defines the tree control's color attributes. | | CurSel | Defines the index of the selected item ([single selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree control). | | [CustomCode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_customcode) | Defines optional product customization. | | [DarkMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_darkmode) | Defines whether the tree control is rendered using a dark color palette. | | [DeleteCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletecallback) | Defines a deletion callback routine, called when items are deleted. | | [DeleteDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletedependents) | Deletes an item's [dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) items. | | [DeleteString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletestring) | Deletes an item. | | [Dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependent) | Returns dependent item information for a parent item. | | [DependentCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependentcount) | Returns the number of dependents for a parent item. | | [DisableNoScroll](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_disablenoscroll) | Defines the scroll bar handling status. | | [DisplayCellRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect) | Returns the location of a cell. | | [DisplayCellRectForItem](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrectforitem) | Returns the location of a cell. | | [DisplayColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycolumn) | Returns the [display column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) given a real column number. | | [DisplayFooterDropDownRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayfooterdropdownrect) | Returns the dimensions of the column [footer dropdown/filter button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dropdown). | | [DisplayFooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayfooterrect) | Returns the dimensions of the [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) area. | | [DisplayHeaderDropDownRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayheaderdropdownrect) | Returns the dimensions of the column header dropdown/filter button. | | [DisplayHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayheaderrect) | Returns the dimensions of the [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) area. | | DPI | Returns the effective DPI for the monitor the tree control is currently displayed on. | | [DragBitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragbitmaps) | Defines the drag & drop starting location attribute. | | [DragImage](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragimage) | Returns a drag image representing the currently selected items. | | DragInfo | Returns drag & drop operation information in a SFTTREE_DRAGINFO structure. | | [DragType](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragtype) | Defines the drag & drop detection attribute. | | [DrawSelectionOutline](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drawselectionoutline) | Draws a selection outline. | | [DropHighlight](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlight) | Defines the current drag & drop target location. | | [DropHighlightStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlightstyle) | Defines the display attribute of the current drag & drop target item. | | [EnableSortIndicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enablesortindicators) | Enables [sort indicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_sortindicator) in column headers. | | [EnterResizeMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enterresizemode) | Allows the user to resize the panes of a split tree control using the keyboard. | | [Expand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expand) | Expands a parent item. | | [ExpandCollapseButtonRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapsebuttonrect) | Returns the location of an item's expand/collapse button. | | [ExpandCollapseIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapseindex) | Returns the zero-based index of the item to expand/collapse. | | [FindItem](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_finditem) | Searches item data. | | [FindString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstring) | Searches a string. | | [FindStringEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringex) | Searches cells for a string. | | [FindStringExact](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringexact) | Searches a string. | | [FirstDisplayColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_firstdisplaycolumn) | Returns the index of the first displayed column. | | [Flyby](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_flyby) | Defines whether [flyby highlighting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_flyby_highlighting) is enabled. | | [FlybyIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_flybyindex) | Returs the index of the highlighted item for flyby highlighting. | | [Footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footer) | Defines a column's footer text. | | [FooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerbutton) | Defines the column number of the currently pressed column footer button. | | [FooterFont](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerfont) | Defines the font used for column footer text display. | | [FooterLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerlength) | Returns the length of a column's footer text. | | [FooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerrect) | Returns the dimensions of the column footer area. | | [ForwardChildMsgs](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_forwardchildmsgs) | Defines the child window message handling status. | | [FreeGDIPlusImageLoadedFromFile](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_freegdiplusimageloadedfromfile) | Deletes a [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) image obtained using [SftTree_LoadGDIPlusImageFromFile](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_loadgdiplusimagefromfile). | | [FreeGDIPlusImageLoadedFromResource](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_freegdiplusimageloadedfromresource) | Deletes a GDI+ image obtained using [SftTree_LoadGDIPlusImageFromResource](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_loadgdiplusimagefromresource). | | [GDIPlusAvailable](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_gdiplusavailable) | Returns whether GDI+ support is available. | | [GridStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_gridstyle) | Defines the grid line display style. | | [Header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_header) | Defines a column's header text. | | [HeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerbutton) | Defines the column number of the currently pressed column header button. | | [HeaderFont](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerfont) | Defines the font used for column header text display. | | [HeaderLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerlength) | Returns the length of a column's header text. | | [HeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerrect) | Returns the dimensions of the column header area. | | [HighContrastMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_highcontrast) | Defines whether the tree control honors the [Windows High Contrast](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_highcontrast) accessibility setting. | | [HorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontalextent) | Defines the horizontal extent (in pixels) of the displayable area. | | [HorizontalOffset](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontaloffset) | Defines the current horizontal offset (in pixels) of the displayed area. | | [ImageScaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_imagescaling) | Defines how images drawn by the tree control are scaled relative to the current monitor DPI. | | [Indentation](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_indentation) | Defines the indentation (in pixels) for item levels. | | [InheritBgColor](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_inheritbgcolor) | Defines whether the area to the left of the first cell inherits the cell's background color. | | [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring) | Inserts a new item using a string. | | [ItemBitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itembitmap) | Defines an item's item picture. | | [ItemBitmapAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itembitmapalign) | Defines whether item pictures of items are aligned with the cells of the immediate parent level. | | [ItemData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata) | Defines an item's application-specific value. | | [ItemEditIgnore](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemeditignore) | Defines whether an item is ignored for [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). | | [ItemExpand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpand) | Defines an item's [expand status](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_expandstatus). | | [ItemExpandable](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandable) | Defines whether an item is expandable. | | [ItemExpandCollapseButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandcollapsebutton) | Defines whether an item's expand/collapse button is shown. | | [ItemHeight](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheight) | Returns an item's height (in pixels). | | [ItemHeightMinMax](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheightminmax) | Defines an item's minimum and maximum height (in pixels). | | [ItemID](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemid) | Defines an item's ID. | | [ItemIgnore](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemignore) | Defines whether the item is excluded from optimal column width and row header width calculation. | | [ItemIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemindex) | Returns an item's index given an item ID. | | [ItemLabel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabel) | Defines an item's [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap) information. | | [ItemLabelPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabelpicture) | Defines an item's label picture information. | | [ItemLevel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel) | Defines an item's level number. | | [ItemLines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlines) | Defines the number of text lines used for item height calculation. | | [ItemPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicture) | Defines an item's item picture. | | [ItemPictureAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicturealign) | Defines whether item pictures of items are aligned with the cells of the immediate parent level. | | [ItemRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemrect) | Returns an item's location in client area coordinates. | | [ItemShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemshown) | Defines an item's [visibility status](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_visibilitystatus). | | [ItemsShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemsshown) | Returns the number of items displayable in the tree control's client area, including partial items. | | [ItemsShownComplete](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemsshowncomplete) | Returns the number of items displayable in the tree control's client area, not including partial items. | | [ItemStatus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemstatus) | Defines an item's enabled/disabled status. | | [KeyHandling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_keyhandling) | Defines keystrokes intercepted during cell editing. | | [LastDisplayColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_lastdisplaycolumn) | Returns the index of the last displayed column. | | [LeftWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_leftwindow) | Returns the window handle or object of the tree control in the left pane of a split tree control. | | [MakeCellVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecellvisible) | Scrolls the specified cell into view horizontally and vertically so that it is displayed in the tree control's client area. | | [MakeContentWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecontentwindow) | Defines the specified window as a [content window](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_contentwindows) (virtual mode only). | | LoadGDIPlusImageFromFile | Loads a GDI+ image from a file. | | LoadGDIPlusImageFromResource | Loads a GDI+ image from an application's or DLL's resources. | | [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal) | Sets the optimal column width so that the text and pictures of all items can be displayed without being clipped horizontally. | | [MakeColumnVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnvisible) | Scrolls the specified column into view horizontally so that it is displayed in the tree control's client area. | | [MakeIntegralHeight](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makeintegralheight) | Resizes the tree control vertically so visible items are displayed in their entirety. | | [MakeRowHeaderOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowheaderoptimal) | Sets the optimal row header width so that the text and pictures of all row headers can be displayed. | | [MakeRowVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowvisible) | Scrolls the specified item into view vertically so that it is displayed in the tree control's client area. | | [MakeSplitterOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makesplitteroptimal) | Positions the splitter bar optimally, so the left pane can display as much data as possible without a horizontal scroll bar. | | [MoveItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_moveitems) | Moves a group of items to a new position in the tree control. | | [MultilineFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilinefooter) | Defines whether column footers can display multiple lines of text. | | [MultilineHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilineheader) | Defines whether column headers can display multiple lines of text. | | [NextShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nextshown) | Returns the next visible item. | | [NoFocusStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nofocusstyle) | Defines the display style of selected items when the tree control does not have the input focus. | | [OpenEnded](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_openended) | Defines whether the last column is open-ended. | | [OverheadWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_overheadwidth) | Returns the width of the area added to the first column for hierarchical graphics components. | | [OwnerDrawCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback) | Defines an application-supplied owner-draw function, which is called whenever an object needs to be rendered. | | [Parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_parent) | Returns an item's parent index. | | [Pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures) | Registers the size and sets the default item pictures used for all items. | | [PixelScaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pixelscaling) | Defines how caller-supplied pixel dimensions are interpreted relative to the current monitor DPI. | | [PlusMinus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_plusminus) | Defines the [plus/minus bitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_plusminus_bitmap) used for all items. | | [PrevShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_prevshown) | Returns the previous visible item. | | [RealColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_realcolumn) | Returns the real column number given a display column number. | | [RecalcHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_recalchorizontalextent) | Recalculates the optimal [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling) extent. | | [RegisterApp](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_registerapp) | Registers an application with SftTree/DLL. | | [ReorderColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_reordercolumns) | Defines whether columns can be reordered using [column drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_drag_drop). | | [ResetContent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resetcontent) | Removes all items from the tree control. | | [ResetSortIndicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resetsortindicators) | Removes all sort indicators from all columns. | | [ResizeColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizecolumn) | Returns the column number of the column being resized. | | [ResizeFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizefooter) | Defines whether column footers are resizable by the user. | | [ResizeHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizeheader) | Defines whether column headers are resizable by the user. | | [RightWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rightwindow) | Returns the window handle or object of the tree control in the right pane of a split tree control. | | [RowColBitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmap) | Defines the picture displayed in the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). | | [RowColBitmapStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmapstyle) | Defines the position of the picture displayed in the row/column header. | | [RowColFooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterbutton) | Defines whether the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) button is currently down (pressed). | | [RowColFooterPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterpicture) | Defines the picture displayed in the row/column footer. | | [RowColFooterPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterpicturestyle) | Defines the position of the picture displayed in the row/column footer. | | [RowColFooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterrect) | Returns the dimensions of the row/column footer area. | | [RowColFooterStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterstyle) | Defines the position of the text displayed in the row/column footer. | | [RowColFooterText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfootertext) | Defines the row/column footer text. | | [RowColFooterTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfootertextlength) | Returns the row/column footer text length. | | [RowColHeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderbutton) | Defines whether the row/column header button is currently down (pressed). | | [RowColHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderrect) | Returns the dimensions of the row/column header area. | | [RowColHeaderPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicture) | Defines the picture displayed in the row/column header. | | [RowColHeaderPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicturestyle) | Defines the position of the picture displayed in the row/column header. | | [RowColHeaderStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderstyle) | Defines the position of the text displayed in the row/column header. | | [RowColHeaderText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertext) | Defines the row/column header text. | | [RowColHeaderTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertextlength) | Returns the row/column header text length. | | [RowColPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolpicture) | Defines the picture displayed in the row/column header. | | [RowColPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolpicturestyle) | Defines the position of the picture displayed in the row/column header. | | [RowColText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcoltext) | Defines the row/column header text. | | [RowColTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcoltextlength) | Returns the row/column header text length. | | [RowHeaderFont](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderfont) | Defines the font used for row header text display. | | [RowHeaderLines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderlines) | Defines the number of text lines used for row header height calculation. | | [RowHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderrect) | Returns the dimensions of the row header area. | | [RowHeaderStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderstyle) | Defines the position of text displayed in the row headers. | | [RowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderwidth) | Defines the width of the row header area. | | RowInfo | Defines an item's row header attributes. | | [RowText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtext) | Defines an item's row header text. | | [RowTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtextlength) | Returns an item's row header text length. | | [RubberbandSelection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rubberbandselection) | Defines whether click-drag selection of multiple items using a selection rectangle is supported. | | [ScrollTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_scrolltips) | Defines whether ScrollTips are displayed during vertical scrolling. | | [Sel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sel) | Defines the selection status of an item (multiple selection tree only). | | [SelCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selcount) | Returns the number of currently selected items (multiple selection tree only). | | [SelectionArea](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionarea) | Defines the area where selection changes occur. | | [SelectionStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle) | Defines the display style of selected items. | | [SelectString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectstring) | Searches a string and selects the matching item. | | [SelectStringExact](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectstringexact) | Searches a string and selects the matching item. | | [SelItemRange](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemrange) | Selects or deselects a range of items (multiple selection tree only). | | [SelItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitems) | Fills an array with the index numbers of currently selected items. | | SelItemsArray | Returns an array of SFTTREE_SELENTRY structures describing groups of selected items. | | [Show3D](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_show3d) | Defines the current display method used for items. | | [ShowBitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbitmaps) | Returns a value indicating the presence of item pictures. | | [ShowButton0](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbutton0) | Defines the presence of level 0 expand/collapse buttons. | | [ShowButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbuttons) | Defines the presence of expand/collapse buttons (other than level 0). | | [ShowFocus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfocus) | Defines whether a focus rectangle is drawn around the current item when the tree control has the input focus. | | [ShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter) | Defines the presence of column footers. | | [ShowFooterButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooterbuttons) | Defines the presence of column footers buttons. | | [ShowGrid](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showgrid) | Defines the presence of [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines). | | [ShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader) | Defines the presence of column headers. | | [ShowHeaderButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheaderbuttons) | Defines the presence of column header buttons. | | [ShowLabels](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showlabels) | Returns the presence of label pictures. | | [ShowPlusMinus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showplusminus) | Returns the presence of plus/minus bitmaps. | | [ShowRowColFooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowcolfooterbutton) | Defines the row/column footer's display style. | | [ShowRowColHeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowcolheaderbutton) | Defines the row/column header's display style. | | [ShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) | Defines the row header display style. | | [ShowTruncated](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showtruncated) | Defines whether text is clipped or truncated using trailing "...". | | [Sibling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sibling) | Returns an item's [sibling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_siblings) information. | | [SizeBox](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sizebox) | Defines whether a size box is shown in the tree control's lower-right corner so the user can resize the control. | | [SortColumn1](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortcolumn1) | Returns information about the currently sorted column. | | SortDependents | Sorts items. | | [SortIndicator](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortindicator) | Defines the sort information for the specified columns. | | [SplitColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitcolumn) | Defines the number of columns displayed in the left pane of a split tree control. | | [SplitterOffset](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffset) | Defines the offset of the splitter bar relative to the left edge of the tree control's client area. | | [SplitterOffsetMin](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffsetmin) | Defines a minimum splitter bar offset to prevent the user from hiding the left pane of a split tree control. | | [SplitterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterrect) | Returns the location of the splitter bar in client area coordinates. | | [SplitterWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterwidth) | Defines the width of the splitter bar in a split tree control. | | StartAutoExpandTimer | Starts a timer for the specified item, so a SFTTREEN_AUTOEXPANDING notification will be sent. | | [StopAutoExpandTimer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_stopautoexpandtimer) | Ends a started SFTTREEN_AUTOEXPANDING notification timer. | | [TabKeyIntercept](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tabkeyintercept) | Defines the status of Tab key handling during cell editing. | | [Text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text) | Defines an item's cell text. | | [TextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_textlength) | Returns the length of an item's cell text. | | [ToolTipAlways](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipalways) | Defines whether ToolTips are shown even if cell text is not truncated. | | ToolTipsCallback | Defines an application supplied callback function, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. | | [ToolTipsUseEntireCell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipsuseentirecell) | Defines whether ToolTips use the entire cell. | | [TopIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_topindex) | Defines the index number of the item shown at the top of the tree control. | | [TopParent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_topparent) | Returns the highest level parent index number for an item. | | [TreeLineStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_treelinestyle) | Defines the display style of [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines). | | [UnregisterApp](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_unregisterapp) | Unregisters an application from SftTree/DLL. | | [UpdateCaretExpandCollapse](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_updatecaretexpandcollapse) | Defines whether the current location (caret) is updated when the expand/collapse buttons are used. | | [UseSmoothScroll](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_usesmoothscroll) | Defines whether smooth scrolling is used. | | [UseThemes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_usethemes) | Defines whether the control can use [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes). | | [VAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_valign) | Defines the vertical alignment of tree lines, label pictures, plus/minus bitmap and item pictures. | | [VirtualCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualcount) | Defines the number of items when using a virtual data source. | | VirtualInitialize | Initializes a tree control for virtual mode and for use with a virtual data source. | | [VirtualItemChanged](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualitemchanged) | Notifies a tree control using a virtual data source that items have been changed. | | [VirtualUserData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualuserdata) | Returns the application defined value last used in the SFTTREE_VIRTUALDEF structure when VirtualInitialize was called. | See Also [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## ~CSftTree *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_csfttreedes* Standard destructor. C++ ``` CSftTree::~CSftTree(); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ~CSftTreeSplit *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_csfttreesplitdes* Standard destructor. C++ ``` CSftTreeSplit::~CSftTreeSplit(); ``` See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## AccessColumn *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn* Defines the current column accessed by column specific functions. C ``` int WINAPI SftTree_GetAccessColumn(HWND hwndCtl); int WINAPI SftTree_SetAccessColumn(HWND hwndCtl, int realCol); int WINAPI SftTreeSplit_GetAccessColumn(HWND hwndCtl); int WINAPI SftTreeSplit_SetAccessColumn(HWND hwndCtl, int realCol); ``` C++ ``` int CSftTree::GetAccessColumn() const; int CSftTree::SetAccessColumn(int realCol = 0); int CSftTreeSplit::GetAccessColumn() const; int CSftTreeSplit::SetAccessColumn(int realCol = 0); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number to become the current column. ### Returns GetAccessColumn returns the zero-based column number of the current column being accessed by column specific messages/functions. SetAccessColumn returns the column being accessed before the new current column is defined. -1 is returned if an error occurred. ### Comments > GetAccessColumn and SetAccessColumn are provided for compatibility with SftTree 1.0 only. Applications should use the new form of functions that supports a column number argument. The GetAccessColumn function returns the current column accessed by column specific functions. The SetAccessColumn function sets the current column accessed by column specific functions. The following functions access the current column when the column number is not explicitly specified: [FindString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstring), [FindStringExact](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringexact), [GetHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_header), [GetHeaderLen](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerlength), [GetText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text), [GetTextLen](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_textlength), [SelectString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectstring), [SelectStringExact](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectstringexact), SetHeader, SetText, [SortDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents). When a tree control is created, the current column is column 0. The column number returned or set by this function remains in effect until changed by a call to SetAccessColumn or any other function where a column number is explicitly specified. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## AddString *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring* Adds a new item to a tree control. The new item is added as the last item at level 0. C ``` int SftTree_AddString(HWND hwndCtl, LPCTSTR lpszText); int WINAPI SftTree_AddString_A(HWND hwndCtl, LPCSTR lpszText); int WINAPI SftTree_AddString_W(HWND hwndCtl, LPCWSTR lpszText); int SftTreeSplit_AddString(HWND hwndCtl, LPCTSTR lpszText); int WINAPI SftTreeSplit_AddString_A(HWND hwndCtl, LPCSTR lpszText); int WINAPI SftTreeSplit_AddString_W(HWND hwndCtl, LPCWSTR lpszText); ``` C++ ``` int CSftTree::AddString(LPCTSTR lpszText); int CSftTreeSplit::AddString(LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. lpszText A null-terminated string that is to be used as text for the [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) of the first (or only) column. ### Returns The return value is the zero-based index of the newly added item. The return value is -1 if an error occurred. ### Comments The AddString function adds a new item to a tree control. The new item is added as the last item at level 0. By default, new items are added at level 0. Use [SetItemLevel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel) to change an item's level. The tree control creates a copy of the string supplied. The WM_SETREDRAW Windows message (CWnd::SetRedraw) can be used to suppress the tree control from being redrawn when many items are added. The use of WM_SETREDRAW is strongly recommended when adding many items to the tree control, as it avoids significant processing while items are added and drastically reduces the time needed to populate the tree control. WM_SETREDRAW (FALSE) should be used once, then all items should be added followed by one final WM_SETREDRAW (TRUE) message. [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring) can be used to insert items at a specific position. Items can be deleted using [DeleteString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletestring). The maximum number of items is the maximum positive number which can be represented by the "int" type. However, virtual storage will be depleted well before this theoretical limit can be reached, not to mention the excessive load-time. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## AdjustCellEditRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_adjustcelleditrect* Returns a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell)'s location in client area coordinates of the left or right pane of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). C ``` BOOL WINAPI SftTree_AdjustCellEditRect(HWND hwndCtl, int index, int realCol, LPRECT lpRect); BOOL WINAPI SftTreeSplit_AdjustCellEditRect(HWND hwndCtl, int index, int realCol, LPRECT lpRect); ``` C++ ``` BOOL CSftTree::AdjustCellEditRect(int index, int realCol, LPRECT lpRect) const; BOOL CSftTreeSplit::AdjustCellEditRect(int index, int realCol, LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the cell for which the position is to be adjusted. realCol The zero-based column number of the cell for which the position is to be adjusted. lpRect The coordinates of the cell relative to the client area of the tree control, usually retrieved using [GetDisplayCellRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect). On return, these coordinates are adjusted to be relative to the client area of the left or right pane of a split tree control. In a tree control without splitter bar, this function has no effect. ### Returns The return value is TRUE if the function was successful, otherwise FALSE. ### Comments The AdjustCellEditRect function returns a cell's location in client area coordinates of the left or right pane of a split tree control. This function is used for [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). Controls such as edit controls or combo boxes, which are created by the application for cell editing, are created with the tree control as the parent window. When a split tree control is used, the control must be attached to the left or right pane, not the tree control. AdjustCellEditRect is used to calculate the coordinates for the control relative to the left or right pane, one of which is the parent window of the control. [GetCellEditWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_celleditwindow) is used to retrieve the window handle of the pane, which will be the [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) of the control used for cell editing. AdjustCellEditRect has no effect in a tree control without splitter bar. But it is recommended to use AdjustCellEditRect in case the application is later converted to use a split tree control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Announce *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_announce* Pushes short application-status text to attached [screen readers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_accessibility) through a UI Automation [notification](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) event. C ``` void SftTree_Announce(HWND hwndCtl, LPCTSTR lpszText, DWORD flags); void WINAPI SftTree_Announce_A(HWND hwndCtl, LPCSTR lpszText, DWORD flags); void WINAPI SftTree_Announce_W(HWND hwndCtl, LPCWSTR lpszText, DWORD flags); void SftTreeSplit_Announce(HWND hwndCtl, LPCTSTR lpszText, DWORD flags); void WINAPI SftTreeSplit_Announce_A(HWND hwndCtl, LPCSTR lpszText, DWORD flags); void WINAPI SftTreeSplit_Announce_W(HWND hwndCtl, LPCWSTR lpszText, DWORD flags); ``` C++ ``` void CSftTree::Announce(LPCTSTR lpszText, DWORD flags = SFTTREE_ANNOUNCE_INFO); void CSftTreeSplit::Announce(LPCTSTR lpszText, DWORD flags = SFTTREE_ANNOUNCE_INFO); ``` ### Parameters hwndCtl The window handle of the tree control. lpszText The text to announce. A short, complete phrase describing an application status change - for example "3 rows added", "Filter cleared", "Saved", "Cannot delete - item is referenced". The text should be something the user would want spoken, not a verbose log message. An empty or NULL string is silently ignored. flags Defines the kind of announcement and its delivery priority. *flags* combines one kind value and, optionally, the SFTTREE_ANNOUNCE_ASSERTIVE priority override. | | | | --- | --- | | SFTTREE_ANNOUNCE_INFO | Informational announcement, polite delivery. The assistive technology may dedup or drop the announcement if the user is currently interacting with other UI. This is the default. | | SFTTREE_ANNOUNCE_SUCCESS | An action has completed successfully. Polite delivery. | | SFTTREE_ANNOUNCE_WARNING | A notable but non-fatal situation the user should know about. Polite delivery. | | SFTTREE_ANNOUNCE_ERROR | An action has been aborted or has failed. Polite delivery. | | SFTTREE_ANNOUNCE_POLITE | Alias for SFTTREE_ANNOUNCE_INFO describing the default (polite / deduped) delivery mode. | | SFTTREE_ANNOUNCE_ASSERTIVE | Bit flag that can be combined with any of the kind values above (for example *SFTTREE_ANNOUNCE_ERROR \| SFTTREE_ANNOUNCE_ASSERTIVE*) to override the assistive technology's normal drop / dedup policy. The announcement will preempt any pending utterance. Use sparingly and only for information the user must hear. | ### Comments The Announce function pushes short application-status text to attached screen readers (Narrator, NVDA, JAWS, etc.) through a UI Automation notification event. The tree control itself does not render the text visually - Announce is a speech-only side channel intended for momentary status updates that would otherwise be invisible to users relying on assistive technologies. Typical uses: - confirming a destructive action ("3 items deleted", "Tree reset"), - reporting an operation result ("Saved", "Export complete", "No items matched"), - reporting filter or sort changes ("Filter cleared", "Sorted by Name, ascending"), - reporting progress milestones for long-running operations. Announce has zero cost when no assistive technology is listening - the tree control queries UiaClientsAreListening before building the event and skips the call entirely otherwise. It is also a silent no-op on Windows versions earlier than Windows 10 version 1709 (build 16299), where UIA notification events are not supported. Empty or NULL text is likewise a no-op. Announce is independent of the tree control's UI Automation provider. Announcements are raised on the tree control's existing provider and do not require the application to register its own UIA provider. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## AutoExpand *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpand* Defines whether items are automatically expanded when the mouse hovers over a collapsed [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent). C ``` BOOL WINAPI SftTree_GetAutoExpand(HWND hwndCtl); void WINAPI SftTree_SetAutoExpand(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetAutoExpand(HWND hwndCtl); void WINAPI SftTreeSplit_SetAutoExpand(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetAutoExpand() const; void CSftTree::SetAutoExpand(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetAutoExpand() const; void CSftTreeSplit::SetAutoExpand(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE so the [SFTTREEN_AUTOEXPANDING](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification is sent to the application when the mouse hovers over a collapsed parent item. Otherwise, set to FALSE. ### Returns GetAutoExpand returns TRUE if the SFTTREEN_AUTOEXPANDING notification is enabled, otherwise FALSE is returned. ### Comments The GetAutoExpand and SetAutoExpand functions define whether items are automatically expanded when the mouse hovers over a collapsed parent item. The [SetControlInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controlinfo) function can be used to define the delay after which a collapsed parent item is automatically expanded ([SFTTREE_CONTROL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control), autoExpandHoverInterval). If enabled, the SFTTREEN_AUTOEXPANDING notification is sent to the application when the mouse hovers over a collapsed parent item. An application must handle the SFTTREEN_AUTOEXPANDING notification and expand the item returned by [GetExpandCollapseIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapseindex). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## AutoExpandItem *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpanditem* Returns the zero-based index of the item to be expanded as a result of a call to [StartAutoExpandTimer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_startautoexpandtimer) or [SetAutoExpand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpand). C ``` int WINAPI SftTree_GetAutoExpandItem(HWND hwndCtl); int WINAPI SftTreeSplit_GetAutoExpandItem(HWND hwndCtl); ``` C++ ``` int CSftTree::GetAutoExpandItem() const; int CSftTreeSplit::GetAutoExpandItem() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns GetAutoExpandItem returns the zero-based index of the item to be expanded as a result of a call to StartAutoExpandTimer or SetAutoExpand. ### Comments The GetAutoExpandItem function returns the zero-based index of the item to be expanded as a result of a call to StartAutoExpandTimer or SetAutoExpand. The index returned by GetAutoExpandItem is valid immediately after a call to StartAutoExpandTimer or while the mouse hovers over a collapsed [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent), even before the item needs to be expanded using a [SFTTREEN_AUTOEXPANDING](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification. Once the SFTTREEN_AUTOEXPANDING notification occurs, [GetExpandCollapseIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapseindex) is used to retrieve the index value. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## BackgroundBitmap *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_backgroundbitmap* Defines a background bitmap used as the background for the tree control. C ``` BOOL WINAPI SftTree_SetBackgroundBitmap(HWND hwndCtl, HBITMAP hBitmap, UINT flag, int xOffs, int yOffs); BOOL WINAPI SftTreeSplit_SetBackgroundBitmap(HWND hwndCtl, HBITMAP hBitmap, UINT flag, int xOffs, int yOffs); ``` C++ ``` BOOL CSftTree::SetBackgroundBitmap(int val = 0, UINT flag = 0, int xOffs = 0, int yOffs = 0); BOOL CSftTree::SetBackgroundBitmap(const CBitmap& Bitmap, UINT flag = 0, int xOffs = 0, int yOffs = 0); BOOL CSftTreeSplit::SetBackgroundBitmap(int val = 0, UINT flag = 0, int xOffs = 0, int yOffs = 0); BOOL CSftTreeSplit::SetBackgroundBitmap(const CBitmap& Bitmap, UINT flag = 0, int xOffs = 0, int yOffs = 0); ``` ### Parameters hwndCtl The window handle of the tree control. hBitmap, Bitmap Describes the bitmap used as the background throughout the tree control. Any reasonable size bitmap can be used. flag Defines additional effects: | | | | --- | --- | | SFTTREE_BGBITMAP_CENTER | The background bitmap is vertically and horizontally centered in the client area of the tree control. The background bitmap is not tiled. [Bitmap transparency](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_bitmap_transparency) is used for this display style. | | SFTTREE_BGBITMAP_HSCROLL | The background bitmap is scrolled horizontally when the tree control is scrolled horizontally. The background bitmap is tiled if the background bitmap is too small to fill the entire client area of the tree control. Bitmap transparency is not used for this display style. | | 0 | The background bitmap is not scrolled horizontally. The background bitmap is tiled if the background bitmap is too small to fill the entire client area of the tree control. Bitmap transparency is not used for this display style. | xOffs Specifies a horizontal offset, relative to the top left edge of the tree control window. *xOffs* and *yOffs* describe a point relative to the top left edge of the tree control with which the bitmap should be aligned. The background bitmap is aligned with the top left edge of the tree control window (not the client area) if 0 is specified. This value is ignored when SFTTREE_BGBITMAP_CENTER is used. yOffs Specifies a vertical offset, relative to the top left edge of the tree control window. *xOffs* and *yOffs* describe a point relative to the top left edge of the tree control with which the bitmap should be aligned. The background bitmap is aligned with the top left edge of the tree control window (not the client area) if 0 is specified. This value is ignored when SFTTREE_BGBITMAP_CENTER is used. val The only allowable value is 0, which is used to clear the background bitmap. ### Returns The return value is TRUE if the function was successful, otherwise FALSE. ### Comments The SetBackgroundBitmap function defines a background bitmap used as the background for the tree control. There is no default background bitmap. Bitmap transparency is only used if *flag* is defined as SFTTREE_BGBITMAP_CENTER. If the background bitmap is too small to fill the entire client area of the tree control, it is tiled unless *flag* is defined as SFTTREE_BGBITMAP_CENTER. The [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) area, [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) area and [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) do not display the background bitmap. These areas are not transparent. If a background bitmap is used, the background colors defined for the tree control, [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) and [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) should be set to the default value [SFTTREE_NOCOLOR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor) so these do not interfere with the background bitmap. When using the [extended window style](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles_ext) WS_EX_RIGHT for [right-to-left reading support](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_rtl), the bitmap origin is the top, **right** corner of the tree control window. *xOffs* and *yOffs* specify offsets relative to the top right edge of the tree control window. In this case the bitmap is also tiled right to left. Background bitmaps may cause slow repainting of the control, particularly on older systems and when the window area is unusually large. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Bitmaps *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_bitmaps* Registers the size and sets the default [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) used for all items. C ``` BOOL WINAPI SftTree_SetBitmaps(HWND hwndCtl, HBITMAP *lphBitmap); BOOL WINAPI SftTreeSplit_SetBitmaps(HWND hwndCtl, HBITMAP *lphBitmap); ``` C++ ``` BOOL CSftTree::SetBitmaps(int val = 0); BOOL CSftTree::SetBitmaps(const CBitmap Bitmap[3]); BOOL CSftTreeSplit::SetBitmaps(int val = 0); BOOL CSftTreeSplit::SetBitmaps(const CBitmap Bitmap[3]); ``` ### Parameters hwndCtl The window handle of the tree control. lphBitmap, Bitmap Three bitmaps to be used as default item pictures. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, all item pictures must be the same size. These three bitmaps are used as default item pictures for 1) an expandable [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent), 2) an expanded parent item and 3) a [leaf item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_leaf). The top, left pixel of each bitmap must contain the picture's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL or omitted to stop displaying item pictures. val The only allowable value is 0, which is used to stop displaying item pictures. ### Returns The return value is TRUE if the function was successful, otherwise FALSE. ### Comments The SetBitmaps function registers the size and sets the default item pictures used for all items. There are no default item pictures. SetBitmaps can be used to define default item pictures using bitmap handles only. [SetPictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures) can be used to define default item pictures using additional picture types such as icons or ImageList images. In a fixed height tree control, all item pictures used for all items must be the same size. New images can be registered at any time, but all item pictures in use must be replaced by images of the new size. In a variable height tree control, item pictures can be of varying sizes. The largest picture size must be registered using SetBitmaps or SetPictures. Item pictures defined using [SetItemPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicture) must be of equal or smaller size. Individual item pictures can be set using SetItemPicture, but will not be shown unless default pictures have been registered using SetBitmaps or SetPictures. The height of all [tree items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_items) is adjusted automatically to allow the complete picture to be displayed. The default pictures can be changed even after items have been added to the tree control. Items without individual item bitmap will immediately use the new default bitmaps. The application retains ownership of the bitmaps and cannot delete these until the tree control no longer uses the bitmaps (usually until the tree control is destroyed or the bitmaps are changed using SetBitmaps or SetPictures). An individual item's item picture can be defined using SetItemPicture. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Buttons *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_buttons* Registers the size and sets the images used for [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons). C ``` BOOL WINAPI SftTree_SetButtons(HWND hwndCtl, HBITMAP hButtons); BOOL WINAPI SftTreeSplit_SetButtons(HWND hwndCtl, HBITMAP hButtons); ``` C++ ``` BOOL CSftTree::SetButtons(int val = 0); BOOL CSftTree::SetButtons(HBITMAP Bitmap); BOOL CSftTree::SetButtons(const CBitmap& Bitmap); BOOL CSftTreeSplit::SetButtons(int val = 0); BOOL CSftTreeSplit::SetButtons(HBITMAP Bitmap); BOOL CSftTreeSplit::SetButtons(const CBitmap& Bitmap); ``` ### Parameters hwndCtl The window handle of the tree control. hButtons, Bitmap A predefined value or a bitmap containing four equal-sized images of an expand/collapse button in the following 4 states: - up, expandable item. The default is a 12 x 11 button with a '+' image. - up, expanded item. The default is a 12 x 11 button with a '-' image. - down, expandable item. The default is a 12 x 11 button with a '+' image. - down, expanded item. The default is a 12 x 11 button with a '-' image. The buttons are arranged horizontally in the bitmap, so the height of the bitmap is the height of one button and the width of the bitmap is four times the width of one button. The top, left pixel of each button image must contain the background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL or omitted to restore the default, built-in bitmap. The following predefined button styles are available: | | | | --- | --- | | SFTTREE_BUTTON_STANDARD | Small gray button image with + and - symbols. | | SFTTREE_BUTTON_STDWIDE | Wide gray button image with + and - symbols. | | SFTTREE_BUTTON_LARGE | Large gray button image with up and down symbols. | | SFTTREE_BUTTON_SIMPLE | White box with + and - symbols, similar to Windows Explorer. | | SFTTREE_BUTTON_MODERN | The button style is not based on a bitmap. It is determined by the Windows release and is rendered by Windows. **Note:** On Windows XP and above, the button will always be rendered using the "Windows Classic" style, as standard buttons supported by most themes are not suitable for use as expand/collapse buttons due to their small size. | | SFTTREE_BUTTON_THEMED | Button image as used on Windows XP. This style is not limited to Windows XP as it is based on a bitmap. No actual [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) are used. | | SFTTREE_BUTTON_AUTOMATIC | Depending on the Windows version and available features, the control selects the appropriate button style. On Windows XP (and above) with themes, SFTTREE_BUTTON_THEMED is selected. On all other Windows versions or if themes are not available, SFTTREE_BUTTON_MODERN is selected. | | SFTTREE_BUTTON_AUTOMATIC2 | Depending on the Windows version and available features, the control selects the appropriate button style. On Windows XP (and above) with themes, the button image is rendered using the currently selected Windows theme. On all other Windows versions or if themes are not available, SFTTREE_BUTTON_SIMPLE is selected. A Windows Vista themed button looks like a Windows XP button. For a look similar to Windows Explorer on Windows Vista, select SFTTREE_BUTTON_AUTOMATIC3 instead. | | SFTTREE_BUTTON_AUTOMATIC3 | Depending on the Windows version and available features, the control selects the appropriate button style. On Windows XP with themes, the button image is rendered using the currently selected Windows theme. On Windows Vista (and above) with themes, a look similar to Windows Explorer is used (based on [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) images). On all other Windows versions or if themes are not available, SFTTREE_BUTTON_SIMPLE is selected. | | SFTTREE_BUTTON_USERDEF | The expand/collapse button images are defined using the members *ButtonExpanded*, *ButtonCollapsed* of the [SFTTREE_CONTROL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control) structure using Get/[SetControlInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controlinfo). | val The only allowable value is 0, which is used to restore the default, built-in bitmap. ### Returns The return value is TRUE if the function was successful, otherwise FALSE. ### Comments Registers the size and sets the images used for expand/collapse buttons. All items use the same expand/collapse bitmap. Expand/collapse buttons are only shown if enabled using [SetShowButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbuttons) and/or [SetShowButton0](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbutton0). The application retains ownership of the bitmap and cannot delete the bitmap until the tree control no longer uses the bitmap (usually until the tree control is destroyed or the bitmap is changed using SetButtons). Sample bitmaps for expand/collapse buttons are provided in the directory \Program Files\Softelvdm\SftTree DLL 8.0\Images. On Windows 64-bit versions, the root folder is \Program Files** (x86)**. Expand/collapse buttons for individual items can be suppressed using the [SetItemExpandCollapseButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandcollapsebutton) function. When using SFTTREE_BUTTON_AUTOMATIC3 to adapt the button style based on the current operating system used, the application must be marked as supporting specific operating systems (see [https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241](https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241)). Users can further override the determined operating system using the application's compatibility settings. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CalcCellFromPoint *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccellfrompoint* Calculates the item index and column number given a point in tree control client area coordinates. C ``` BOOL WINAPI SftTree_CalcCellFromPoint(HWND hwndCtl, LPPOINT lpPt, int * lpIndex, int * lpCol); BOOL WINAPI SftTreeSplit_CalcCellFromPoint(HWND hwndCtl, LPPOINT lpPt, int * lpIndex, int * lpCol); ``` C++ ``` BOOL CSftTree::CalcCellFromPoint(LPPOINT lpPt, int* lpIndex, int* lpCol) const; BOOL CSftTreeSplit::CalcCellFromPoint(LPPOINT lpPt, int* lpIndex, int* lpCol) const; ``` ### Parameters hwndCtl The window handle of the tree control. lpPt The x and y coordinates in pixels (relative to the upper left corner of the tree control), for which the item index and column number need to be calculated. lpIndex A pointer to an integer where the item index is returned. lpCol A pointer to an integer where the column number is returned. ### Returns The return value is TRUE if the function was successful, otherwise FALSE. ### Comments The CalcCellFromPoint function calculates the item index and column number given a point in tree control client area coordinates. If the location *lpPt* is not located in a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), FALSE is returned. Use [CalcIndexFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcindexfrompoint) to determine the item index or [CalcColumnFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccolumnfrompoint) to determine the column number. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CalcColumnFromPoint *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccolumnfrompoint* Calculates the column number given a point in tree control client area coordinates. C ``` int WINAPI SftTree_CalcColumnFromPoint(HWND hwndCtl, LPPOINT lpPt); int WINAPI SftTree_CalcColumnFromPointEx(HWND hwndCtl, LPPOINT lpPt); int WINAPI SftTreeSplit_CalcColumnFromPoint(HWND hwndCtl, LPPOINT lpPt); int WINAPI SftTreeSplit_CalcColumnFromPointEx(HWND hwndCtl, LPPOINT lpPt); ``` C++ ``` int CSftTree::CalcColumnFromPoint(LPPOINT lpPt) const; int CSftTree::CalcColumnFromPointEx(LPPOINT lpPt) const; int CSftTreeSplit::CalcColumnFromPoint(LPPOINT lpPt) const; int CSftTreeSplit::CalcColumnFromPointEx(LPPOINT lpPt) const; ``` ### Parameters hwndCtl The window handle of the tree control. lpPt The x and y coordinates in pixels (relative to the upper left corner of the tree control), for which the column number needs to be calculated. ### Returns The return value is the column number at the given location. The return value is -1 if no column is located at the specified point. ### Comments The CalcColumnFromPoint and CalcColumnFromPointEx functions calculate the column number given a point in tree control client area coordinates. CalcColumnFromPoint always returns the actual column number. CalcColumnFromPointEx considers merged [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) and returns the column number of the first column in a group of merged column headers. Use [CalcIndexFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcindexfrompoint) to determine the item index or [CalcCellFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccellfrompoint) to determine the [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CalcIndexFromPoint *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcindexfrompoint* Calculates the item index number given a point in tree control client area coordinates. C ``` int WINAPI SftTree_CalcIndexFromPoint(HWND hwndCtl, LPPOINT lpPt); int WINAPI SftTree_CalcIndexFromPointEx(HWND hwndCtl, LPPOINT lpPt); int WINAPI SftTreeSplit_CalcIndexFromPoint(HWND hwndCtl, LPPOINT lpPt); int WINAPI SftTreeSplit_CalcIndexFromPointEx(HWND hwndCtl, LPPOINT lpPt); ``` C++ ``` int CSftTree::CalcIndexFromPoint(LPPOINT lpPt) const; int CSftTree::CalcIndexFromPointEx(LPPOINT lpPt) const; int CSftTreeSplit::CalcIndexFromPoint(LPPOINT lpPt) const; int CSftTreeSplit::CalcIndexFromPointEx(LPPOINT lpPt) const; ``` ### Parameters hwndCtl The window handle of the tree control. lpPt The x and y coordinates in pixels (relative to the upper left corner of the tree control), for which the item index number needs to be calculated. ### Returns The return value is the zero-based index of the item at the given location. The return value is -1 if no item is located at the specified point. ### Comments The CalcIndexFromPoint and CalcIndexFromPointEx functions calculate the item index number given a point in tree control client area coordinates. If *lpPt* is at the bottom of the tree control above a partially visible item, CalcIndexFromPoint will return -1, CalcIndexFromPointEx returns the index of the item in this case. CalcIndexFromPoint will return the index of the last item in the tree control if the *lpPt* location is above the empty area at the end of the item list. CalcIndexFromPointEx returns the index of the last item + 1 in this case. If the location *lpPt* is in the column or [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) area or outside the tree control client area, -1 is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CalcLimit *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calclimit* Defines the maximum number of items to consider for optimal column width and scrolling calculation. C ``` int WINAPI SftTree_GetCalcLimit(HWND hwndCtl); void WINAPI SftTree_SetCalcLimit(HWND hwndCtl, int limit); int WINAPI SftTreeSplit_GetCalcLimit(HWND hwndCtl); void WINAPI SftTreeSplit_SetCalcLimit(HWND hwndCtl, int limit); ``` C++ ``` int CSftTree::GetCalcLimit() const; void CSftTree::SetCalcLimit(int limit = 0); int CSftTreeSplit::GetCalcLimit() const; void CSftTreeSplit::SetCalcLimit(int limit = 0); ``` ### Parameters hwndCtl The window handle of the tree control. limit Defines the maximum number of items to be considered for width calculation. Specify a number less than or equal to 0 to consider all items. If a tree control contains many items, scanning all items may be extremely slow, as each [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) or [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) width needs to be calculated. Using an application defined maximum number, the calculation can be limited to *limit* items. This results in better response time, yet some items which are not within the number of scanned items may still be clipped. ### Returns GetCalcLimit returns the maximum number of items to be considered for optimal column width and scrolling calculation. ### Comments The GetCalcLimit and SetCalcLimit functions define the maximum number of items to consider for optimal column width and scrolling calculation. This function is used to define the maximum number of items to be considered when using [SftTree_CalcOptimalColumnWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth), [SftTree_CalcOptimalRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalrowheaderwidth), [SftTree_MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal), [SftTree_MakeRowHeaderOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowheaderoptimal) and [SftTree_RecalcHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_recalchorizontalextent). The C implementation of these functions does not support the *limit* parameter. SetCalcLimit is not normally used with C++ as the equivalent C++ functions support *limit* as a parameter. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CalcOptimalCellDimensions *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcelldimensions* Calculates a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell)'s optimal height and width so its contents aren't truncated. C ``` int WINAPI SftTree_CalcOptimalCellDimensions(HWND hwndCtl, int index, int realCol, int maxAllowedWidth, LPINT lpWidth, LPINT lpHeight); int WINAPI SftTreeSplit_CalcOptimalCellDimensions(HWND hwndCtl, int index, int realCol, int maxAllowedWidth, LPINT lpWidth, LPINT lpHeight); ``` C++ ``` int CSftTree::CalcOptimalCellDimensions(int index, int realCol, int maxAllowedWidth, int& Width, int& Height) const; int CSftTreeSplit::CalcOptimalCellDimensions(int index, int realCol, int maxAllowedWidth, int& Width, int& Height) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item, whose cell dimensions are to be calculated. realCol The zero-based column number of the cell. maxAllowedWidth Defines the maximum allowed width to consider. Specify -1 to allow the width to be optimal for the cell contents. lpWidth, Width Returns the calculated width, in pixels. lpHeight, Height Returns the calculated height, in pixels. ### Returns CalcOptimalCellDimensions returns 1- if an error occurs, 0 otherwise. ### Comments The CalcOptimalCellDimensions function calculates a cell's optimal height and width so its contents aren't truncated. Typically, the [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal) function can be used instead to let the control determine the optimal column width. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CalcOptimalColumnWidth *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth* Calculates a column's optimal width so text and pictures are not clipped. C ``` int WINAPI SftTree_CalcOptimalColumnWidth(HWND hwndCtl, int realCol); int WINAPI SftTreeSplit_CalcOptimalColumnWidth(HWND hwndCtl, int realCol); ``` C++ ``` int CSftTree::CalcOptimalColumnWidth(int realCol, int limit = 0, BOOL fVisibleOnly = FALSE); int CSftTreeSplit::CalcOptimalColumnWidth(int realCol, int limit = 0, BOOL fVisibleOnly = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose optimal width is to be calculated. limit Defines the maximum number of items to be considered for width calculation. Specify a number less than or equal to 0 to consider all items. If a tree control contains many items, scanning all items may be extremely slow, as each [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell)'s width needs to be calculated. Using an application defined maximum number, the calculation can be limited to *limit* items. This results in better response time, yet some items which are not within the number of scanned items may still be clipped. fVisibleOnly Specify TRUE to limit the width calculation to visible items only. Items which are not visible because their [parent items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are collapsed are not included in the width calculation. ### Returns Returns the optimal column width in pixels. The return value is -1 if an error occurred. ### Comments The CalcOptimalColumnWidth function calculates a column's optimal width so text and pictures are not clipped. CalcOptimalColumnWidth returns the optimal width of a specified column so that the [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers)'s and each cell's text and picture can be completely displayed without being truncated or clipped. The column width can be changed using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns). [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal) can be used to set a column's optimal width without having to calculate it first. The SftTree_CalcOptimalColumnWidth function does not support the parameters *limit* and *fVisibleOnly*. Use the [SetCalcLimit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calclimit) and [SetCalcVisibleOnly](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcvisibleonly) functions to supply this information before calling SftTree_CalcOptimalColumnWidth. By changing tree control item attributes, the optimal column width may change. Adding items, setting new cell texts and changing [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) are a few of the actions that can affect the optimal column width. The column width may have to be set again to allow items to be completely visible. The tree control does not automatically adjust column widths. Items can be excluded from optimal column width calculation by using the [SetItemIgnore](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemignore) function or for [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode), setting the [SFTTREEITEM_IGNORE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) value in the *flag2* member of the SFTTREE_ITEM structure. Individual cells can be ignored from optimal column width calculation by setting the [SFTTREECELL_IGNORE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) value in the *flag2* member of the SFTTREE_CELL structure. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CalcOptimalRowHeaderWidth *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalrowheaderwidth* Calculates the optimal width for [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) so text and pictures are not clipped. C ``` int WINAPI SftTree_CalcOptimalRowHeaderWidth(HWND hwndCtl); int WINAPI SftTreeSplit_CalcOptimalRowHeaderWidth(HWND hwndCtl); ``` C++ ``` int CSftTree::CalcOptimalRowHeaderWidth(int limit = 0, BOOL fVisibleOnly = FALSE); int CSftTreeSplit::CalcOptimalRowHeaderWidth(int limit = 0, BOOL fVisibleOnly = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. limit Defines the maximum number of items to be considered for width calculation. Specify a number less than or equal to 0 to consider all items. If a tree control contains many items, scanning all items may be extremely slow, as each row header width needs to be calculated. Using an application defined maximum number, the calculation can be limited to *limit* items. This results in better response time, yet some items which are not within the number of scanned items may still be clipped. fVisibleOnly Specify TRUE to limit the width calculation to visible items only. Items which are not visible because their [parent items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are collapsed are not included in the width calculation. ### Returns The return value is the optimal row header area width in pixels. The return value is -1 if an error occurred. ### Comments The CalcOptimalRowHeaderWidth function calculates the optimal width for row headers so text and pictures are not clipped. CalcOptimalRowHeaderWidth calculates the optimal width of the row header area so that the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header)'s text and picture and the row header text and pictures can be completely displayed without being truncated or clipped. The row header width can be changed using [SetRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderwidth). [MakeRowHeaderOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowheaderoptimal) can be used to set the optimal row header width without having to calculate it first. The SftTree_CalcOptimalRowHeaderWidth function does not support the parameters *limit* and *fVisibleOnly*. Use the [SetCalcLimit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calclimit) and [SetCalcVisibleOnly](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcvisibleonly) functions to supply this information before calling SftTree_CalcOptimalRowHeaderWidth. By changing tree control attributes, the optimal row header width may change. Adding items, setting new row header pictures and changing row header text are a few of the actions that can affect the optimal row header width. The row header width may have to be set again to allow items to be completely visible. The tree control does not automatically adjust the row header width. Items can be excluded from optimal row header width calculation by using the [SetItemIgnore](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemignore) function or for [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode), setting the [SFTTREEITEM_IGNORE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) value in the *flag2* member of the SFTTREE_ITEM structure. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CalcVisibleOnly *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcvisibleonly* Defines whether only visible items are considered for optimal column width and scrolling calculation. C ``` BOOL WINAPI SftTree_GetCalcVisibleOnly(HWND hwndCtl); void WINAPI SftTree_SetCalcVisibleOnly(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetCalcVisibleOnly(HWND hwndCtl); void WINAPI SftTreeSplit_SetCalcVisibleOnly(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetCalcVisibleOnly() const; void CSftTree::SetCalcVisibleOnly(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetCalcVisibleOnly() const; void CSftTreeSplit::SetCalcVisibleOnly(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Specify TRUE to limit the width calculation to visible items only. Items which are not visible because their [parent items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are collapsed are not included in the width calculation. ### Returns GetCalcVisibleOnly returns TRUE if only visible items are considered, FALSE otherwise. ### Comments The GetCalcVisibleOnly and SetCalcVisibleOnly functions define whether only visible items are considered for optimal column width and scrolling calculation. This function is used to define whether only visible items should be considered when using [SftTree_CalcOptimalColumnWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth), [SftTree_CalcOptimalRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalrowheaderwidth), [SftTree_MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal), [SftTree_MakeRowHeaderOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowheaderoptimal) and [SftTree_RecalcHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_recalchorizontalextent). The C implementation of these functions does not support the *fSet* parameter. SetCalcVisibleOnly is not normally used with C++ as the equivalent C++ functions support this as a parameter. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CaretColumn *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretcolumn* Returns the column where a mouse button was last clicked. C ``` int WINAPI SftTree_GetCaretColumn(HWND hwndCtl); int WINAPI SftTreeSplit_GetCaretColumn(HWND hwndCtl); ``` C++ ``` int CSftTree::GetCaretColumn() const; int CSftTreeSplit::GetCaretColumn() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the zero-based column number where a mouse button was last clicked. The return value is -1 if the mouse button has been clicked outside of a column. ### Comments The GetCaretColumn function returns the column where a mouse button was last clicked. As a tree control, SftTree/DLL does not support [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) selection, only item selection is possible using [SetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex). Consequently, a "SetCaretColumn" function is not available. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CaretIndex *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex* Defines the current item (caret location). C ``` int WINAPI SftTree_GetCaretIndex(HWND hwndCtl); int WINAPI SftTree_SetCaretIndex(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetCaretIndex(HWND hwndCtl); int WINAPI SftTreeSplit_SetCaretIndex(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetCaretIndex() const; int CSftTree::SetCaretIndex(int index); int CSftTreeSplit::GetCaretIndex() const; int CSftTreeSplit::SetCaretIndex(int index); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item which will become the current item. ### Returns GetCaretIndex returns the zero-based index of the item that has the focus rectangle. SetCaretIndex returns 0 if the function was successful, otherwise -1. ### Comments The GetCaretIndex and SetCaretIndex functions define the current item (caret location). GetCaretIndex retrieves the index of the item that has the focus rectangle. The item may or may not also be selected. The display of the focus rectangle can be controlled using [SetShowFocus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfocus). SetCaretIndex automatically makes the current item visible, its parents are expanded if necessary and the item is displayed in the tree window area. The item is not automatically selected. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CellEditWindow *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_celleditwindow* Returns the window containing the specified [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) in a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). C ``` HWND WINAPI SftTree_GetCellEditWindow(HWND hwndCtl, int index, int realCol); HWND WINAPI SftTreeSplit_GetCellEditWindow(HWND hwndCtl, int index, int realCol); ``` C++ ``` CWnd* CSftTree::GetCellEditWindow(int index, int realCol = 0) const; CWnd* CSftTreeSplit::GetCellEditWindow(int index, int realCol = 0) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the cell for which the window is to be retrieved. realCol The zero-based column number of the cell for which the window is to be retrieved. ### Returns The return value is the window (handle) of the left or right pane of a split tree control or the window (handle) of the tree control if no splitter bar is used. ### Comments The GetCellEditWindow function returns the window containing the specified cell in a split tree control. This function is used for [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). Controls such as edit control or combo boxes which are created by the application for cell editing are created with the tree control as the parent window. When a split tree control is used, the control must be attached to the left or right pane, not the tree control. GetCellEditWindow is used to determine the window (handle) of the left or right pane. [AdjustCellEditRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_adjustcelleditrect) is used to calculate the coordinates for the control relative to the left or right pane. GetCellEditWindow has no effect in a tree control without splitter bar. But it is recommended to use GetCellEditWindow in case the application is later converted to use a split tree control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CellInfo *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo* Defines a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell)'s attributes. C ``` BOOL WINAPI SftTree_GetCellInfo(HWND hwndCtl, LPSFTTREE_CELLINFOPARM lpCellParm); BOOL WINAPI SftTree_SetCellInfo(HWND hwndCtl, LPCSFTTREE_CELLINFOPARM lpCellParm); BOOL WINAPI SftTreeSplit_GetCellInfo(HWND hwndCtl, LPSFTTREE_CELLINFOPARM lpCellParm); BOOL WINAPI SftTreeSplit_SetCellInfo(HWND hwndCtl, LPCSFTTREE_CELLINFOPARM lpCellParm); ``` C++ ``` BOOL CSftTree::GetCellInfo(LPSFTTREE_CELLINFOPARM lpCellParm) const; BOOL CSftTree::SetCellInfo(LPCSFTTREE_CELLINFOPARM lpCellParm); BOOL CSftTreeSplit::GetCellInfo(LPSFTTREE_CELLINFOPARM lpCellParm) const; BOOL CSftTreeSplit::SetCellInfo(LPCSFTTREE_CELLINFOPARM lpCellParm); ``` ### Parameters hwndCtl The window handle of the tree control. lpCellParm A pointer to a [SFTTREE_CELLINFOPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cellinfoparm) structure which holds the required parameters. ### Returns The return value is TRUE if the function is successful, otherwise FALSE is returned. ### Comments The GetCellInfo and SetCellInfo functions define a cell's attributes. To modify a cell's attributes, the GetCellInfo function is used to retrieve its current attributes. The [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) structure, part of the SFTTREE_CELLINFOPARM structure, can then be modified, setting the desired attributes. Finally, the cell is updated by a call to the SetCellInfo function. [Cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) can be retrieved using [GetText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text) and modified using SetText. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, all [cell pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap) used for all cells must be the same size. In a variable height tree control, cell pictures can be of varying sizes. The (largest) cell picture size must be registered using SetCellInfo. A cell may have an associated cell picture without the picture actually being visible. The cell picture doesn't become visible until the cell picture size has been registered using SetCellInfo by setting the index member of the SFTTREE_CELLINFOPARM structure to -1. Only one picture is used to register the picture size. After registering the picture size, any number of pictures may be used. A new picture size can be registered at any time, but in a fixed height tree control, all cell pictures in use must be replaced by pictures of the new size. [Pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures) are owned by the application and the associated bitmap, icon or ImageList handles have to remain valid as long as the tree control uses them. Handles have to be deleted by the application once they are no longer needed. Fonts are owned by the application and the associated font handles have to remain valid as long as the tree control uses them. Fonts have to be deleted using DeleteObject once they are no longer needed. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetCellInfo can only be used to register the cell picture size. Cell attributes cannot be modified. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CellRectInfo *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellrectinfo* Returns the location of a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) and [cell picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap). C ``` BOOL WINAPI SftTree_GetCellRectInfo(HWND hwndCtl, int index, int realCol, LPRECT lpCellRect, LPRECT lpPictureRect, LPRECT lpTextRect); BOOL WINAPI SftTreeSplit_GetCellRectInfo(HWND hwndCtl, int index, int realCol, LPRECT lpCellRect, LPRECT lpPictureRect, LPRECT lpTextRect); ``` C++ ``` BOOL CSftTree::GetCellRectInfo(int index, int realCol, LPRECT lpCellRect, LPRECT lpPictureRect = NULL, LPRECT lpTextRect = NULL) const; BOOL CSftTreeSplit::GetCellRectInfo(int index, int realCol, LPRECT lpCellRect, LPRECT lpPictureRect = NULL, LPRECT lpTextRect = NULL) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the cell position is to be retrieved. realCol The zero-based column number of the cell for which the position is to be retrieved. lpCellRect A pointer to a RECT structure where the location of the cell is returned (in pixels). lpPictureRect A pointer to a RECT structure where the location of the cell picture is returned (in pixels). This parameter may be NULL. If a cell doesn't have a cell picture, an empty rectangle is returned. lpTextRect A pointer to a RECT structure where the location of the cell text is returned (in pixels). This parameter may be NULL. If a cell doesn't have cell text, an empty rectangle is returned. ### Returns GetCellRectInfo returns TRUE if successful, otherwise FALSE is returned. ### Comments > GetCellRectInfo is provided for compatibility with SftTree/DLL 4.5 (and earlier) only. Applications should use the [GetCellRectInfoEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellrectinfoex) function instead. The GetCellRectInfo function returns the location of a cell, the cell text and cell picture. The returned rectangles *lpRect*, *lpPictureRect* and *lpTextRect* are clipped to the tree control's client area and are adjusted for [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling). [GetDisplayCellRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect) can be used to retrieve the coordinates of a cell. [GetItemRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemrect) returns the coordinates of an entire item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CellRectInfoEx *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellrectinfoex* Returns the location of a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) and [cell picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap). C ``` BOOL WINAPI SftTree_GetCellRectInfoEx(HWND hwndCtl, int index, int realCol, BOOL fClient, LPRECT lpCellRect, LPRECT lpPictureRect, LPRECT lpTextRect); BOOL WINAPI SftTreeSplit_GetCellRectInfoEx(HWND hwndCtl, int index, int realCol, BOOL fClient, LPRECT lpCellRect, LPRECT lpPictureRect, LPRECT lpTextRect); ``` C++ ``` BOOL CSftTree::GetCellRectInfoEx(int index, int realCol, BOOL fClient, LPRECT lpCellRect, LPRECT lpPictureRect = NULL, LPRECT lpTextRect = NULL) const; BOOL CSftTreeSplit::GetCellRectInfoEx(int index, int realCol, BOOL fClient, LPRECT lpCellRect, LPRECT lpPictureRect = NULL, LPRECT lpTextRect = NULL) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the cell position is to be retrieved. realCol The zero-based column number of the cell for which the position is to be retrieved. fClient Set to TRUE to limit the returned rectangles *lpRect*, *lpPictureRect* and *lpTextRect* to the tree control's client area and to adjust for [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling). If set to FALSE, the rectangles returned are not clipped to the client area or otherwise adjusted for horizontal scrolling. lpCellRect A pointer to a RECT structure where the location of the cell is returned (in pixels). lpPictureRect A pointer to a RECT structure where the location of the cell picture is returned (in pixels). This parameter may be NULL. If a cell doesn't have a cell picture, an empty rectangle is returned. lpTextRect A pointer to a RECT structure where the location of the cell text is returned (in pixels). This parameter may be NULL. If a cell doesn't have cell text, an empty rectangle is returned. ### Returns GetCellRectInfoEx returns TRUE if successful, otherwise FALSE is returned. ### Comments The GetCellRectInfoEx function returns the location of a cell, the cell text and cell picture. [GetDisplayCellRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect) can be used to retrieve the coordinates of a cell. [GetItemRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemrect) returns the coordinates of an entire item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CharSearchMode *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_charsearchmode* Defines the method used to search for matching items in response to characters typed by the user. C ``` int WINAPI SftTree_GetCharSearchMode(HWND hwndCtl); void WINAPI SftTree_SetCharSearchMode(HWND hwndCtl, int mode, int realCol); int WINAPI SftTreeSplit_GetCharSearchMode(HWND hwndCtl); void WINAPI SftTreeSplit_SetCharSearchMode(HWND hwndCtl, int mode, int realCol); ``` C++ ``` int CSftTree::GetCharSearchMode() const; void CSftTree::SetCharSearchMode(int mode = SFTTREE_CHARSEARCH_ONECHAR, int realCol = -1); int CSftTreeSplit::GetCharSearchMode() const; void CSftTreeSplit::SetCharSearchMode(int mode = SFTTREE_CHARSEARCH_ONECHAR, int realCol = -1); ``` ### Parameters hwndCtl The window handle of the tree control. mode Defines the method used to search for matching items in response to characters typed by the user. *mode* can be one of the following values: | | | | --- | --- | | SFTTREE_CHARSEARCH_ONECHAR | Starting at the current item, the **next** item starting with the one single character typed is located and made current. | | SFTTREE_CHARSEARCH_ALLCHARS | The **first** item in the tree control that matches the character(s) typed within a short time period is located and made current. As the user types additional characters, the search continues. If the user pauses for more than the time interval defined using [SFTTREE_CONTROL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control), nCharSearchMaxInterval (default one second), the search ends. The next character typed starts a new search. | | SFTTREE_CHARSEARCH_NONE | Characters typed are ignored. | | SFTTREE_CHARSEARCH_ALLCHARS2 | Same as SFTTREE_CHARSEARCH_ALLCHARS, but [dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) items of a collapsed [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are not searched. | | SFTTREE_CHARSEARCH_ONECHAR2 | Same as SFTTREE_CHARSEARCH_ONECHAR, but dependent items of a collapsed parent item are not searched. | | SFTTREE_CHARSEARCH_ONECHARWRAP | Starting at the current item, the **next** item starting with the one single character typed is located and made current. If the end of the list of items is reached, the search wraps around and starts at the beginning of the list. | | SFTTREE_CHARSEARCH_ONECHARWRAP2 | Same as SFTTREE_CHARSEARCH_ONECHARWRAP, but dependent items of a collapsed parent item are not searched. | | SFTTREE_CHARSEARCH_ALLCHARSWRAP | The **next** item in the tree control that matches the character(s) typed within a short time period is located and made current. As the user types additional characters, the search continues. If the user pauses for more than the time interval defined using SFTTREE_CONTROL, nCharSearchMaxInterval (default one second), the search ends. The next character typed starts a new search. | | SFTTREE_CHARSEARCH_ALLCHARSWRAP2 | Same as SFTTREE_CHARSEARCH_ALLCHARSWRAP, but dependent items of a collapsed parent item are not searched. | realCol The zero-based column number to be searched. If -1 is specified, the first displayed column is searched. ### Returns GetCharSearchMode returns a value indicating the current search method used. ### Comments The GetCharSearchMode and SetCharSearchMode functions define the method used to search for matching items in response to characters typed by the user. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ClickAgainPos *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_clickagainpos* Returns the location of the item that was clicked again. C ``` BOOL WINAPI SftTree_GetClickAgainPos(HWND hwndCtl, int* index, int* realCol); BOOL WINAPI SftTreeSplit_GetClickAgainPos(HWND hwndCtl, int* index, int* realCol); ``` C++ ``` BOOL CSftTree::GetClickAgainPos(int* index, int* realCol) const; BOOL CSftTreeSplit::GetClickAgainPos(int* index, int* realCol) const; ``` ### Parameters hwndCtl The window handle of the tree control. index A pointer to an integer where the item index is returned. realCol A pointer to an integer where the column number is returned. ### Returns The return value is TRUE if the function was successful, otherwise FALSE. ### Comments The GetClickAgainPos function returns the location of the item that was clicked again. If a mouse button is clicked on a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) (any column) of an already selected item, the [SFTTREEN_LBUTTONDOWN_TEXTAGAIN](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification is generated. The notification is only generated if there is a sufficiently long pause between the first click to select the item and the second click. If the pause is not long enough, the SFTTREEN_LBUTTONDBLCLK_TEXT notification is generated instead. GetClickAgainPos can be used to determine the index and column number where the click occurred when a SFTTREEN_LBUTTONDOWN_TEXTAGAIN notification is generated. Use [CalcIndexFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcindexfrompoint) to determine the item index or [CalcCellFromPoint](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calccellfrompoint) to determine the cell. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## Collapse *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_collapse* Collapses a [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent). C ``` BOOL WINAPI SftTree_Collapse(HWND hwndCtl, int index, BOOL fPreserve); BOOL WINAPI SftTreeSplit_Collapse(HWND hwndCtl, int index, BOOL fPreserve); ``` C++ ``` BOOL CSftTree::Collapse(int index, BOOL fPreserve = TRUE); BOOL CSftTreeSplit::Collapse(int index, BOOL fPreserve = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item to be collapsed. If -1 is specified, all items on level 0 are collapsed. fPreserve Set to TRUE to preserve the expand/collapse state of [dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) items made no longer visible. A subsequent call to [Expand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expand) will restore the items with the remembered expand/collapse state. If FALSE is specified, the expand/collapse state is not preserved. ### Returns The return value is TRUE if successful, otherwise FALSE is returned. ### Comments The Collapse function collapses a parent item. Collapse collapses the specified parent item index, hides all dependent items and saves the expand/collapse state of all dependent items (if fPreserve is set to TRUE), so it can be restored by a subsequent call to Expand. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ColumnsEx *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns* Defines the number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) and column attributes. C ``` int WINAPI SftTree_GetColumnsEx(HWND hwndCtl, LPSFTTREE_COLUMN_EX* lpCols); BOOL WINAPI SftTree_SetColumnsEx(HWND hwndCtl, int count, LPCSFTTREE_COLUMN_EX lpCols); int WINAPI SftTreeSplit_GetColumnsEx(HWND hwndCtl, LPSFTTREE_COLUMN_EX *lpCols); BOOL WINAPI SftTreeSplit_SetColumnsEx(HWND hwndCtl, int count, LPCSFTTREE_COLUMN_EX lpCols); ``` C++ ``` int CSftTree::GetColumns(LPSFTTREE_COLUMN_EX FAR * lpCols) const; BOOL CSftTree::SetColumns(int count, LPSFTTREE_COLUMN_EX lpCols); int CSftTreeSplit::GetColumns(LPSFTTREE_COLUMN_EX FAR * lpCols) const; BOOL CSftTreeSplit::SetColumns(int count, LPSFTTREE_COLUMN_EX lpCols); ``` ### Parameters hwndCtl The window handle of the tree control. count The number of columns to be defined. A [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) entry must be defined for each column. This number may be 0, in which case a single, [open-ended](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_openended) last column is defined (the *lpCols* parameter is ignored). lpCols A pointer to SFTTREE_COLUMN_EX structure(s), one for each column to be defined. This pointer may be NULL if *count* is 0, to define a single column. lpColArray A pointer to a pointer to SFTTREE_COLUMN_EX structure(s). This pointer will be set on return to contain a pointer to column structures, each describing one column. This pointer may be NULL, in which case only the number of columns will be returned. val The only allowable value is 0 or NULL, which is used to retrieve the number of columns (*lpCols* == NULL) or to define a single column (lpColArray == NULL). ### Returns GetColumns returns the number of columns currently defined and sets a pointer to SFTTREE_COLUMN_EX structure(s). SetColumns returns TRUE if the function was successful, FALSE otherwise. ### Comments The GetColumns(Ex) and SetColumns(Ex) functions define the number of columns and column attributes. The pointer returned in parameter lpColArray points to SFTTREE_COLUMN_EX structures, one for each column defined. The values in these structures may be modified (in-place) and updated using SetColumns. > The number of columns can only be modified if the tree control is empty. To define the last column as open-ended use SetOpenEnded. An open-ended last column will display the complete text specified for the last (or only) column and never truncate any data. A fixed-width last column is defined with a specified width and any data which doesn't fit is truncated. Due to the variable number of levels and the resulting hierarchical display, the width of the first column is always treated as a minimum width. The text portion of the first column will always be at least of the specified width, no matter what level the item is on. This can result in the first column being much wider than the defined width. See [GetOverheadWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_overheadwidth) for additional information. An application should use [RecalcHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_recalchorizontalextent) or [SetHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontalextent) to recalculate or set the optimal [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling) extent. > Additional forms of the GetColumns(Ex)/SetColumns(Ex) functions exist, which use a [SFTTREE_COLUMN](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column) structure, but are only provided for compatibility with earlier versions of SftTree/DLL and are not documented. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ControlData *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controldata* Defines an application-defined value. C ``` SFTTREE_DWORD_PTR WINAPI SftTree_GetControlData(HWND hwndCtl); void WINAPI SftTree_SetControlData(HWND hwndCtl, SFTTREE_DWORD_PTR data); SFTTREE_DWORD_PTR WINAPI SftTreeSplit_GetControlData(HWND hwndCtl); void WINAPI SftTreeSplit_SetControlData(HWND hwndCtl, SFTTREE_DWORD_PTR data); ``` C++ ``` SFTTREE_DWORD_PTR CSftTree::GetControlData() const; void CSftTree::SetControlData(SFTTREE_DWORD_PTR data); SFTTREE_DWORD_PTR CSftTreeSplit::GetControlData() const; void CSftTreeSplit::SetControlData(SFTTREE_DWORD_PTR data); ``` ### Parameters hwndCtl The window handle of the tree control. data An application-defined value. ### Returns GetControlData returns the application-defined value last set using the SetControlData function. ### Comments The GetControlData and SetControlData functions define an application-defined value. This application-defined value can be used to store application-specific information with the control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ControlInfo *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controlinfo* Defines the tree control's attributes. C ``` BOOL WINAPI SftTree_GetControlInfo(HWND hwndCtl, LPSFTTREE_CONTROL lpCtl); BOOL WINAPI SftTree_SetControlInfo(HWND hwndCtl, LPSFTTREE_CONTROL lpCtl); BOOL WINAPI SftTreeSplit_GetControlInfo(HWND hwndCtl, LPSFTTREE_CONTROL lpCtl); BOOL WINAPI SftTreeSplit_SetControlInfo(HWND hwndCtl, LPSFTTREE_CONTROL lpCtl); ``` C++ ``` BOOL CSftTree::GetControlInfo(LPSFTTREE_CONTROL lpCtl) const; BOOL CSftTree::SetControlInfo(LPSFTTREE_CONTROL lpCtl); BOOL CSftTreeSplit::GetControlInfo(LPSFTTREE_CONTROL lpCtl) const; BOOL CSftTreeSplit::SetControlInfo(LPSFTTREE_CONTROL lpCtl); ``` ### Parameters hwndCtl The window handle of the tree control. lpColors A pointer to a [SFTTREE_CONTROL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control) structure containing the tree control definitions. GetControlInfo uses this structure to return the current color settings. SetControlInfo uses the contents of this structure to define the new settings. The *cbSize* member of the SFTTREE_CONTROL structure must be initialized to the size of the structure (sizeof(SFTTREE_CONTROL)) before calling GetControlInfo. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetControlInfo and SetControlInfo functions define the tree control's attributes. To modify a control's attributes, the GetControlInfo function is used to retrieve its current attributes. The SFTTREE_CONTROL structure can then be modified, setting the desired attributes. Finally, the control's attributes are updated by a call to the SetControlInfo function. If the SetControlInfo function fails, the SFTTREE_CONTROL structure's *errorValue* member contains an error code, indicating which structure member has caused the failure. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CopyItem *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_copyitem* CopyItem is provided for compatibility with SftTree/DLL 4.5 (and earlier) only. Applications should use the [CopyItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_copyitems) function instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CopyItems *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_copyitems* Copies a group of items to a new location. C ``` int WINAPI SftTree_CopyItems(HWND hwndCtl, int from, int count, int to); int WINAPI SftTreeSplit_CopyItems(HWND hwndCtl, int from, int count, int to); ``` C++ ``` int CSftTree::CopyItems(int from, int count, int to); int CSftTreeSplit::CopyItems(int from, int count, int to); ``` ### Parameters hwndCtl The window handle of the tree control. from The zero-based index of the first item to be copied. count The number of items to be copied. to The zero-based index of the location where the copied items are to be inserted. If *to* is -1, the items will be added at the end of the list. ### Returns The return value is the number of copied items or -1 if an error occurred. ### Comments The CopyItems function copies a group of items to a new location. CopyItems copies all item attributes, including [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text), pictures, level, [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) contents, etc. Also copied are the values set using [SetItemData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata). If these values should remain unique in an application, they have to be explicitly changed after copying items. The target item *to* cannot be inside the group of items to be copied. Items can be moved using the [MoveItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_moveitems) function. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Count *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_count* Returns the number of items in the tree control. C ``` int WINAPI SftTree_GetCount(HWND hwndCtl); int WINAPI SftTreeSplit_GetCount(HWND hwndCtl); ``` C++ ``` int CSftTree::GetCount() const; int CSftTreeSplit::GetCount() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the number of items in the tree control. ### Comments The GetCount function returns the number of items in the tree control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Create *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_create* Creates a tree control window and attaches it to the [CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) or CSftTreeSplit object. C++ ``` BOOL CSftTree::Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); BOOL CSftTree::CreateEx( DWORD dwExStyle, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); BOOL CSftTreeSplit::Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); BOOL CSftTreeSplit::CreateEx( DWORD dwExStyle, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); ``` ### Parameters dwExStyle Specifies the [extended window style](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles_ext) of the tree control. dwStyle Specifies the [window style](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) of the tree control. rect Specifies the tree control size and position. Can be either a CRect object or a RECT structure. pParentWnd Specifies the tree control's parent window. nID Specifies the tree's control ID. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The Create and CreateEx functions define a tree control window and attach it to the CSftTree or CSftTreeSplit object. See Also C/C++ API | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CrossColumnResize *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_crosscolumnresize* Defines whether multiple [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) can be resized during one [column resizing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_resizing) operation. C ``` BOOL WINAPI SftTree_GetCrossColumnResize(HWND hwndCtl); void WINAPI SftTree_SetCrossColumnResize(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetCrossColumnResize(HWND hwndCtl); void WINAPI SftTreeSplit_SetCrossColumnResize(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetCrossColumnResize() const; void CSftTree::SetCrossColumnResize(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetCrossColumnResize() const; void CSftTreeSplit::SetCrossColumnResize(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to allow multiple columns to be resized during one column resizing operation. If set to FALSE, the size of only one column at a time can be affected by the user. ### Returns GetCrossColumnResize returns a value indicating whether multiple columns can be resized. ### Comments The GetCrossColumnResize and SetCrossColumnResize functions define whether multiple columns can be resized during one column resizing operation. SetCrossColumnResize(FALSE) is usually used to prevent a user from making more than one column invisible (by resizing it to a zero width). Otherwise, a user could make several columns invisible by continually resizing the current column. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CSftTree *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_csfttree* Standard constructor. C++ ``` CSftTree::CSftTree(); ``` ### Comments [CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) describes a tree control without [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). A CSftTree object is created in two steps. First call the constructor CSftTree, then use the [CSftTree::Create](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_create) member function, which initializes and creates the tree control window and attaches it to the CSftTree object. See Also C/C++ API | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CSftTreeSplit *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_csfttreesplit* Standard constructor. C++ ``` CSftTreeSplit::CSftTreeSplit(); ``` ### Comments [CSftTreeSplit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) describes a tree control with a [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). A CSftTreeSplit object is created in two steps. First call the constructor CSftTreeSplit, then use the [CSftTreeSplit::Create](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_csfttree_create) member function, which initializes and creates the tree control window and attaches it to the CSftTreeSplit object. See Also C/C++ API | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CtlColors *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors* Defines the tree control's color attributes. C ``` void WINAPI SftTree_GetCtlColors(HWND hwndCtl, LPSFTTREE_COLORS lpColors); void WINAPI SftTree_SetCtlColors(HWND hwndCtl, LPCSFTTREE_COLORS lpColors); void WINAPI SftTreeSplit_GetCtlColors(HWND hwndCtl, LPSFTTREE_COLORS lpColors); void WINAPI SftTreeSplit_SetCtlColors(HWND hwndCtl, LPCSFTTREE_COLORS lpColors); ``` C++ ``` void CSftTree::GetCtlColors(LPSFTTREE_COLORS lpColors) const; void CSftTree::SetCtlColors(LPCSFTTREE_COLORS lpColors); void CSftTreeSplit::GetCtlColors(LPSFTTREE_COLORS lpColors) const; void CSftTreeSplit::SetCtlColors(LPCSFTTREE_COLORS lpColors); ``` ### Parameters hwndCtl The window handle of the tree control. lpColors A pointer to a [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors) structure containing the color definitions. GetCtlColors uses this structure to return the current color settings. SetCtlColors uses the contents of this structure to define the new color settings. ### Comments The GetCtlColors and SetCtlColors functions define the tree control's color attributes. To modify a control's color attributes, the GetCtlColors function is used to retrieve its current attributes. The SFTTREE_COLORS structure can then be modified, setting the desired attributes. Finally, the control's colors are updated by a call to the SetCtlColors function. An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). Many color settings have no effect when [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) are used. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CurSel *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel* Defines the index of the selected item ([single selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree control). C ``` int WINAPI SftTree_GetCurSel(HWND hwndCtl); int WINAPI SftTree_SetCurSel(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetCurSel(HWND hwndCtl); int WINAPI SftTreeSplit_SetCurSel(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetCurSel() const; int CSftTree::SetCurSel(int index); int CSftTreeSplit::GetCurSel() const; int CSftTreeSplit::SetCurSel(int index); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item to be selected. This parameter may be -1 to deselect the currently selected item. ### Returns GetCurSel returns the zero-based index of the currently selected item in a single selection tree control. If no item is selected or if the tree control has the multiple selection attribute, the value -1 is returned. SetCurSel returns the value 0 if the function was successful, otherwise -1 is returned. ### Comments The GetCurSel and SetCurSel functions define the index of the selected item (single selection tree control). GetCurSel and SetCurSel can only be used with single selection tree controls. [GetSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sel) and SetSel are used with multi-selection tree controls. [GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex) can be used to retrieve the current item, i.e. the item that has the focus rectangle. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## CustomCode *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_customcode* Defines optional product customization. C ``` void WINAPI SftTree_SetCustomCode(HWND hwndCtl, long Code); void WINAPI SftTreeSplit_SetCustomCode(HWND hwndCtl, long Code); ``` C++ ``` void CSftTree::SetCustomCode(long Code); void CSftTreeSplit::SetCustomCode(long Code); ``` ### Parameters hwndCtl The window handle of the tree control. Code A value defining product customization. ### Comments The SetCustomCode function defines optional product customization. Valid *Code *values are made available by [Product Support](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_contactsoftel), in response to purchased enhancements, special features, etc. and are only available upon request. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DarkMode *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_darkmode* Defines whether the tree control is rendered using a dark color palette. C ``` void WINAPI SftTree_SetDarkMode(HWND hwndCtl, int mode); int WINAPI SftTree_GetDarkMode(HWND hwndCtl); BOOL WINAPI SftTree_IsDarkModeActive(HWND hwndCtl); void WINAPI SftTreeSplit_SetDarkMode(HWND hwndCtl, int mode); int WINAPI SftTreeSplit_GetDarkMode(HWND hwndCtl); BOOL WINAPI SftTreeSplit_IsDarkModeActive(HWND hwndCtl); ``` C++ ``` void CSftTree::SetDarkMode(int mode); int CSftTree::GetDarkMode() const; BOOL CSftTree::IsDarkModeActive() const; void CSftTreeSplit::SetDarkMode(int mode); int CSftTreeSplit::GetDarkMode() const; BOOL CSftTreeSplit::IsDarkModeActive() const; ``` ### Parameters hwndCtl The window handle of the tree control. mode Defines the [dark mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_darkmode) setting. *mode* can be one of the following values: | | | | --- | --- | | SFTTREE_DARKMODE_OFF | The tree control is always rendered using the light color palette. This is the default. | | SFTTREE_DARKMODE_ON | The tree control is always rendered using the dark color palette, regardless of the Windows system setting. | | SFTTREE_DARKMODE_AUTO | The tree control follows the current Windows "Choose your mode" setting (Light / Dark) and switches automatically when the user changes the system setting. | ### Returns GetDarkMode returns a value indicating the current dark mode setting (SFTTREE_DARKMODE_OFF, SFTTREE_DARKMODE_ON or SFTTREE_DARKMODE_AUTO). IsDarkModeActive returns TRUE if the tree control is currently rendering with the dark color palette, otherwise FALSE. When *mode* is SFTTREE_DARKMODE_AUTO, the return value reflects the current Windows system setting. ### Comments The SetDarkMode, GetDarkMode and IsDarkModeActive functions define and retrieve a tree control's dark mode setting. Dark mode changes the palette used for the tree control's background, text, [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines), selection highlight, header, footer, [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). [Header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_header), footer, row-header and splitter-bar rendering use a dark-aware GDI code path; [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) are suppressed while dark mode is active. When *mode* is SFTTREE_DARKMODE_AUTO, the tree control tracks WM_SETTINGCHANGE [notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) from Windows and re-renders automatically when the user toggles the system Light / Dark setting. A SFTTREEN_DARKMODE_CHANGED notification is sent to the parent window each time the active mode flips so the application can repaint other UI to match. Caller-supplied color overrides set with [SetCtlColors](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors) remain in effect in dark mode unless [high contrast mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_highcontrast) is also active. Owner-draw callbacks receive the current dark state in [SFTTREE_OWNERDRAW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdraw)'s *fDarkMode* field; owner-draw code is responsible for its own dark-mode compliance. SetDarkMode is available on Windows 10 and later. On earlier platforms the setting is stored but has no visual effect. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## DeleteCallback *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletecallback* Defines a deletion callback routine, called when items are deleted. C ``` BOOL WINAPI SftTree_SetDeleteCallback(HWND hwndCtl, LPCSFTTREE_DELETEPARM lpDelete); BOOL WINAPI SftTreeSplit_SetDeleteCallback(HWND hwndCtl, LPCSFTTREE_DELETEPARM lpDelete); ``` C++ ``` BOOL CSftTree::SetDeleteCallback(LPSFTTREE_DELETEPARM lpDelete = NULL); BOOL CSftTreeSplit::SetDeleteCallback(LPSFTTREE_DELETEPARM lpDelete = NULL); ``` ### Parameters hwndCtl The window handle of the tree control. lpDelete A pointer to a [SFTTREE_DELETEPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_deleteparm) structure containing the parameters for this function to register a callback function and user supplied data. This parameter may be NULL to stop using the callback function. The SFTTREE_DELETEPARM structure contains the following members: | | | | --- | --- | | [SFTTREE_DELETEPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_deleteproc) lpfnDelete | A user supplied routine which is called every time an item is deleted. | | [SFTTREE_DWORD_PTR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_dword_ptr) UserData | User supplied, application-specific data. | ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned if an error occurred. ### Comments The SetDeleteCallback function defines a deletion callback routine, called when items are deleted. The callback receives control when an item is about to be deleted. The callback can then perform application specific cleanup processing for the item being deleted. The callback routine is called immediately before the item is deleted. ***![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)***In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DeleteDependents *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletedependents* Deletes an item's [dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) items. C ``` int WINAPI SftTree_DeleteDependents(HWND hwndCtl, int index); int WINAPI SftTreeSplit_DeleteDependents(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::DeleteDependents(int index); int CSftTreeSplit::DeleteDependents(int index); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item, whose dependents are to be deleted. ### Returns The return value is the number of items remaining in the tree control. The return value is -1 if an error occurred. ### Comments The DeleteDependents function deletes an item's dependent items. By deleting an item's dependents, the item becomes a [leaf item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_leaf) which can no longer be expanded or collapsed. It is not an error to use DeleteDependents if an item doesn't have any dependents. The item described by *index* is not deleted. To delete an item, [DeleteString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletestring) can be used. ***![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)***In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DeleteString *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletestring* Deletes an item. C ``` int WINAPI SftTree_DeleteString(HWND hwndCtl, int index); int WINAPI SftTreeSplit_DeleteString(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::DeleteString(int index); int CSftTreeSplit::DeleteString(int index); ``` ### Parameters hwndCtl The window handle of the tree control. index Specifies the zero-based index of the item to be deleted. ### Returns The return value is the number of items remaining in the tree control. The return value is -1 if an error occurred. ### Comments The DeleteString function deletes an item. If a [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) is deleted, [dependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) are deleted if the parent item is collapsed (dependents are not visible). If the parent item is expanded when it is deleted, its dependents are not deleted. If a deletion callback routine has been defined (see [SetDeleteCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletecallback)), the callback is invoked for each item deleted from the tree control. This allows application specific cleanup processing to take place for each item. The WM_SETREDRAW Windows message (CWnd::SetRedraw) can be used to suppress the tree control from being redrawn when many items are deleted. The use of WM_SETREDRAW is strongly recommended when deleting many items from the tree control, as it avoids significant processing while items are deleted and drastically reduces the time needed. WM_SETREDRAW (FALSE) should be used once, then all items should be deleted followed by one final WM_SETREDRAW (TRUE) message. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Dependent *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependent* Returns [dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) item information for a [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent). C ``` int WINAPI SftTree_GetDependent(HWND hwndCtl, int index, int type); int WINAPI SftTreeSplit_GetDependent(HWND hwndCtl, int index, int type); ``` C++ ``` int CSftTree::GetDependent(int index, int type) const; int CSftTreeSplit::GetDependent(int index, int type) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the parent item for which dependent item information is to be retrieved. type A value indicating the type of dependent item information to retrieve. | | | | --- | --- | | SFTTREE_DEPENDENT_FIRST | Retrieves the index of the first dependent. | | SFTTREE_DEPENDENT_LAST | Retrieves the index of the last dependent. | ### Returns The return value is the index of the requested dependent item or -1 if the specified item doesn't have any dependents. ### Comments The GetDependent function returns dependent item information for a parent item. The index returned is not necessarily an immediate dependent. The dependent retrieved may be at any level below the parent item level, not just at the next lower level. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DependentCount *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependentcount* Returns the number of [dependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) for a [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent). C ``` int WINAPI SftTree_GetDependentCount(HWND hwndCtl, int index, BOOL fDepth); int WINAPI SftTreeSplit_GetDependentCount(HWND hwndCtl, int index, BOOL fDepth); ``` C++ ``` int CSftTree::GetDependentCount(int index, BOOL fDepth) const; int CSftTreeSplit::GetDependentCount(int index, BOOL fDepth) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index number of the parent item for which the number of dependents is to be retrieved. fDepth Indicates depth of search. Specify FALSE to count only immediate dependents, i.e. dependents on the next lower level, specify TRUE to count all dependents (on all lower levels). ### Returns The return value is the number of dependents or -1 if an error occurred. ### Comments The GetDependentCount function returns the number of dependents for a parent item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DisableNoScroll *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_disablenoscroll* Defines the scroll bar handling status. C ``` BOOL WINAPI SftTree_GetDisableNoScroll(HWND hwndCtl); void WINAPI SftTree_SetDisableNoScroll(HWND hwndCtl, BOOL fDisable); BOOL WINAPI SftTreeSplit_GetDisableNoScroll(HWND hwndCtl); void WINAPI SftTreeSplit_SetDisableNoScroll(HWND hwndCtl, BOOL fDisable); ``` C++ ``` BOOL CSftTree::GetDisableNoScroll() const; void CSftTree::SetDisableNoScroll(BOOL fDisable = TRUE); BOOL CSftTreeSplit::GetDisableNoScroll() const; void CSftTreeSplit::SetDisableNoScroll(BOOL fDisable = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fDisable A value indicating the desired scroll bar status when scrolling is not possible. Set to TRUE to disable scroll bars, set to FALSE to hide scroll bars. ### Returns GetDisableNoScroll returns TRUE if the [SFTTREESTYLE_DISABLENOSCROLL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) window style is set, otherwise FALSE is returned. ### Comments The GetDisableNoScroll and SetDisableNoScroll functions define the scroll bar handling status. GetDisableNoScroll retrieves the SFTTREESTYLE_DISABLENOSCROLL window style. SetDisableNoScroll manipulates the SFTTREESTYLE_DISABLENOSCROLL window style, which cannot be directly modified. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DisplayCellRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect* Returns the location of a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell). C ``` BOOL WINAPI SftTree_GetDisplayCellRect(HWND hwndCtl, int index, int iCol, BOOL fClient, LPRECT lpRect, int* lpSpan); BOOL WINAPI SftTreeSplit_GetDisplayCellRect(HWND hwndCtl, int index, int iCol, BOOL fClient, LPRECT lpRect, int* lpSpan); ``` C++ ``` BOOL CSftTree::GetDisplayCellRect(int index, int iCol, BOOL fClient, LPRECT lpRect, int* lpSpan) const; BOOL CSftTreeSplit::GetDisplayCellRect(int index, int iCol, BOOL fClient, LPRECT lpRect, int* lpSpan) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the cell position is to be retrieved. iCol The zero-based column number of the cell for which the position is to be retrieved. fClient Set to TRUE to limit the returned rectangle *lpRect* to the tree control's client area and to adjust for [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling). If set to FALSE, the rectangle returned is not clipped to the client area or otherwise adjusted for horizontal scrolling. lpRect A pointer to a RECT structure where the location of the cell is returned (in pixels). lpSpan A pointer to a variable where the number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) is returned that the cell occupies. If [cell merging](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_merging) is allowed and the cell merges into an adjacent cell, it can span more than one column. This parameter may be NULL. ### Returns GetDisplayCellRect returns TRUE if successful, otherwise FALSE is returned. ### Comments The GetDisplayCellRect function returns the location of a cell. The RECT structure *lpRect* describes the location of the specified cell. It can be used for [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing) to create a Windows control of the correct size. [GetCellRectInfoEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellrectinfoex) can be used to retrieve the coordinates of [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) and [cell pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap). [GetItemRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemrect) returns the coordinates of an entire item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DisplayCellRectForItem *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrectforitem* Returns the location of a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell). C ``` BOOL WINAPI SftTree_GetDisplayCellRectForItem(HWND hwndCtl, int index, int displayCol, LPRECT lpRect, int* lpSpan); BOOL WINAPI SftTreeSplit_GetDisplayCellRectForItem(HWND hwndCtl, int index, int displayCol, LPRECT lpRect, int* lpSpan); ``` C++ ``` BOOL CSftTree::GetDisplayCellRectForItem(int index, int displayCol, LPRECT lpRect, int* lpSpan) const; BOOL CSftTreeSplit::GetDisplayCellRectForItem(int index, int displayCol, LPRECT lpRect, int* lpSpan) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the cell position is to be retrieved. displayCol The zero-based column number of the cell for which the position is to be retrieved. lpRect A pointer to a RECT structure where the location of the cell is returned (in pixels). Before calling this function, the height of the item must be provided in this structure. GetDisplayCellRectForItem only updates the width and starting offset of the cell. lpSpan A pointer to a variable where the number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) is returned that the cell occupies. If [cell merging](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_merging) is allowed and the cell merges into an adjacent cell, it can span more than one column. This parameter may be NULL. ### Returns GetDisplayCellRectForItem returns TRUE if successful, otherwise FALSE is returned. ### Comments The GetDisplayCellRectForItem function returns the location of a cell. The RECT structure *lpRect* describes the location of the specified cell. It can be used for [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing) to create a Windows control of the correct size. GetDisplayCellRectForItem only updates the width and starting offset of the cell. If the height of the cell (or item) is not known, the function [GetDisplayCellRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect) can be used instead. [GetItemRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemrect) returns the coordinates of an entire item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DisplayColumn *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycolumn* Returns the [display column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) given a real column number. C ``` int WINAPI SftTree_GetDisplayColumn(HWND hwndCtl, int realCol); int WINAPI SftTreeSplit_GetDisplayColumn(HWND hwndCtl, int realCol); ``` C++ ``` int CSftTree::GetDisplayColumn(int realCol) const; int CSftTreeSplit::GetDisplayColumn(int realCol) const; ``` ### Parameters hwndCtl The window handle of the tree control. realCol The real column number whose display column number is to be returned. ### Returns The return value is the display column number for a real column number, or -1 if an error occurred. ### Comments The GetDisplayColumn function returns the display column number given a real column number. As a user reorders [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns), this is completely transparent to the application. An application still references [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) by the "real" column number, which is the original column number that the cell had before columns were reordered by the user. While columns appear in a new order after dragging a column to a new position, the application references columns and cells by their real column number which never changes. If a user reorders columns using [column drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_drag_drop), the (real) column numbers, which is the column number as it appears to the application, may need to be translated into the display column number as seen by the user. For more information see section "Display vs. Real Columns". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DisplayFooterDropDownRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayfooterdropdownrect* Returns the dimensions of the column [footer dropdown/filter button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dropdown). C ``` BOOL WINAPI SftTree_GetDisplayFooterDropDownRect(HWND hwndCtl, int realCol, LPRECT lpRect); BOOL WINAPI SftTreeSplit_GetDisplayFooterDropDownRect(HWND hwndCtl, int realCol, LPRECT lpRect); ``` C++ ``` BOOL CSftTree::GetDisplayFooterDropDownRect(int dispCol, LPRECT lpRect) const; BOOL CSftTreeSplit::GetDisplayFooterDropDownRect(int dispCol, LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose location is to be retrieved. lpRect A pointer to a RECT structure where the location of the requested column footer dropdown/filter button is returned. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetDisplayFooterDropDownRect function returns the dimensions of the column footer dropdown/filter button. The coordinates returned in *lpRect* are coordinates relative to the tree control's client area (in pixels). The dimensions of the entire footer area can be retrieved using [GetFooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerrect). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DisplayFooterRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayfooterrect* Returns the dimensions of the [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) area. C ``` BOOL WINAPI SftTree_GetDisplayFooterRect(HWND hwndCtl, int realCol, LPRECT lpRect, int* lpSpan); BOOL WINAPI SftTreeSplit_GetDisplayFooterRect(HWND hwndCtl, int realCol, LPRECT lpRect, int* lpSpan); ``` C++ ``` BOOL CSftTree::GetDisplayFooterRect(int dispCol, LPRECT lpRect, int* lpSpan) const; BOOL CSftTreeSplit::GetDisplayFooterRect(int dispCol, LPRECT lpRect, int* lpSpan) const; ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose location is to be retrieved. lpRect A pointer to a RECT structure where the location of the requested column footer is returned. lpSpan A pointer to a variable where the number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) is returned that the column footer occupies. If [cell merging](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_merging) is allowed and the column footer merges into an adjacent column footer, a column footer can span more than one column. This parameter may be NULL. ### Returns GetDisplayFooterRect returns TRUE if successful, otherwise FALSE is returned. ### Comments The GetDisplayFooterRect function returns the dimensions of the column footer area. The coordinates returned in *lpRect* are coordinates relative to the tree control's client area (in pixels). The dimensions of the entire footer area can be retrieved using [GetFooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerrect). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DisplayHeaderDropDownRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayheaderdropdownrect* Returns the dimensions of the column [header dropdown/filter button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dropdown). C ``` BOOL WINAPI SftTree_GetDisplayHeaderDropDownRect(HWND hwndCtl, int realCol, LPRECT lpRect); BOOL WINAPI SftTreeSplit_GetDisplayHeaderDropDownRect(HWND hwndCtl, int realCol, LPRECT lpRect); ``` C++ ``` BOOL CSftTree::GetDisplayHeaderDropDownRect(int dispCol, LPRECT lpRect) const; BOOL CSftTreeSplit::GetDisplayHeaderDropDownRect(int dispCol, LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose location is to be retrieved. lpRect A pointer to a RECT structure where the location of the requested column header dropdown/filter button is returned. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetDisplayHeaderDropDownRect function returns the dimensions of the column header dropdown/filter button. The coordinates returned in *lpRect* are coordinates relative to the tree control's client area (in pixels). The dimensions of the entire header area can be retrieved using [GetHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerrect). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DisplayHeaderRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayheaderrect* Returns the dimensions of the [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) area. C ``` BOOL WINAPI SftTree_GetDisplayHeaderRect(HWND hwndCtl, int realCol, LPRECT lpRect, int* lpSpan); BOOL WINAPI SftTreeSplit_GetDisplayHeaderRect(HWND hwndCtl, int realCol, LPRECT lpRect, int* lpSpan); ``` C++ ``` BOOL CSftTree::GetDisplayHeaderRect(int dispCol, LPRECT lpRect, int* lpSpan) const; BOOL CSftTreeSplit::GetDisplayHeaderRect(int dispCol, LPRECT lpRect, int* lpSpan) const; ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose location is to be retrieved. lpRect A pointer to a RECT structure where the location of the requested column header is returned. lpSpan A pointer to a variable where the number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) is returned that the column header occupies. If [cell merging](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_merging) is allowed and the column header merges into an adjacent column header, a column header can span more than one column. This parameter may be NULL. ### Returns GetDisplayHeaderRect returns TRUE if successful, otherwise FALSE is returned. ### Comments The GetDisplayHeaderRect function returns the dimensions of the column header area. The coordinates returned in *lpRect* are coordinates relative to the tree control's client area (in pixels). The dimensions of the entire header area can be retrieved using [GetHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerrect). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DPI *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dpi* Returns the effective DPI for the monitor the tree control is currently displayed on. C ``` int WINAPI SftTree_GetDPI(HWND hwndCtl); int WINAPI SftTreeSplit_GetDPI(HWND hwndCtl); ``` C++ ``` int CSftTree::GetDPI() const; int CSftTreeSplit::GetDPI() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the effective DPI (dots-per-inch) for the monitor the tree control is currently displayed on. 96 represents 100% scaling, 120 represents 125%, 144 represents 150%, 192 represents 200%, and so on. If the host process is not [Per-Monitor DPI](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dpi) aware, the return value is the System DPI and does not change for the lifetime of the process. ### Comments The GetDPI function returns the effective DPI for the monitor the tree control is currently displayed on. The tree control uses this value internally to scale row height, grid-line thickness, scroll-bar metrics, drag thresholds, 3D frame widths, the column drop-down button, expand / collapse glyphs and the resize-handle bitmap via GetSystemMetricsForDpi and MulDiv. Applications that host SftTree controls in a Per-Monitor v2 DPI-aware window receive a SFTTREEN_DPI_CHANGED [notification](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) whenever the window moves to a monitor of a different DPI, or the system DPI changes. In response, the application should: - re-send WM_SETFONT with a font sized for the new DPI (SftTree does not own the application's font), - re-register any caller-supplied [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), label, item, row-header, column-header and column-footer images at the new physical size if [SftTree_SetImageScaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_imagescaling) is SFTTREE_IMAGESCALING_ASIS. Callers that have opted into [SFTTREE_PIXELSCALING_STRETCH](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pixelscaling) do not need to rescale column widths, indentation, row-header width, horizontal extent or item heights - the tree control handles those automatically. Callers that have opted into SFTTREE_IMAGESCALING_STRETCH do not need to re-register images at the new physical size. Owner-draw callbacks receive the current DPI in [SFTTREE_OWNERDRAW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdraw)'s *dpi* field; owner-draw code should read the field on every paint and must not cache pixel metrics across callbacks. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## DragBitmaps *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragbitmaps* Defines the [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) starting location attribute. C ``` BOOL WINAPI SftTree_GetDragBitmaps(HWND hwndCtl); void WINAPI SftTree_SetDragBitmaps(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetDragBitmaps(HWND hwndCtl); void WINAPI SftTreeSplit_SetDragBitmaps(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetDragBitmaps() const; void CSftTree::SetDragBitmaps(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetDragBitmaps() const; void CSftTreeSplit::SetDragBitmaps(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to enable a drag & drop operation to start from an [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) or [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap), otherwise set to FALSE. ### Returns GetDragBitmaps returns TRUE if a drag & drop operation can start from an item picture or label picture, otherwise FALSE is returned. ### Comments The GetDragBitmaps and SetDragBitmaps functions define the drag & drop starting location attribute. A tree control must be defined using the [SFTTREESTYLE_DRAGDROP](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) window style to support drag & drop. A drag & drop operation can always be started from an item's [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell). By using SetDragBitmaps, a drag & drop operation can also be initiated from a picture. The actual method used to determine when a drag & drop operation is initiated by a user is defined using [SetDragType](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragtype). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DragImage *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragimage* Returns a drag image representing the currently selected items. C ``` HBITMAP WINAPI SftTree_GetDragImage(HWND hwndCtl, int index, LPRECT lpRect, COLORREF *lpColorBg); HBITMAP WINAPI SftTreeSplit_GetDragImage(HWND hwndCtl, int index, LPRECT lpRect, COLORREF *lpColorBg); ``` C++ ``` HBITMAP CSftTree::GetDragImage(int index, LPRECT lpRect, COLORREF *lpColorBg) const; HBITMAP CSftTreeSplit::GetDragImage(int index, LPRECT lpRect, COLORREF *lpColorBg) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item where dragging originated (one of possibly many items). In the current version of the product, this index is not used, but is validated. It is reserved for future expansion. lpRect Returns the bitmap dimensions and position, based on the currently selected item(s). lpColorBg Returns the background color of the tree control. This parameter may be NULL. ### Returns GetDragImage returns a bitmap handle representing the currently selected item(s). ### Comments The GetDragImage function returns a drag image representing the currently selected items. The returned bitmap handle is owned by the application and must be destroyed using the Windows DeleteObject function. This drag image can be used with the IDropTargetHelper and IDragSourceHelper interfaces to provide a translucent drag image. IDropTargetHelper and IDragSourceHelper interfaces are provided by the Windows Shell starting with Windows 2000 and Windows ME. SftTree/DLL has no built-in support for OLE [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) or translucent drag images, as these functions are normally controlled by the application or framework, not by an individual control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DragInfo *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_draginfo* Returns [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) operation information in a [SFTTREE_DRAGINFO](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_draginfo) structure. C ``` LPSFTTREE_DRAGINFO WINAPI SftTree_GetDragInfo(HWND hwndCtl); LPSFTTREE_DRAGINFO WINAPI SftTreeSplit_GetDragInfo(HWND hwndCtl); ``` C++ ``` LPSFTTREE_DRAGINFO CSftTree::GetDragInfo() const; LPSFTTREE_DRAGINFO CSftTreeSplit::GetDragInfo() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is a pointer to a SFTTREE_DRAGINFO structure. ### Comments The GetDragInfo function returns drag & drop operation information in a SFTTREE_DRAGINFO structure. A tree control must be defined using the [SFTTREESTYLE_DRAGDROP](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) window style to support drag & drop. The SFTTREE_DRAGINFO structure returned is only valid if the calling application is currently processing a [SFTTREEN_BEGINDRAG](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications), SFTTREEN_DRAGGING, SFTTREEN_ENDDRAG or SFTTREEN_CANCELDRAG notification. When processing multiple notifications, the SFTTREE_DRAGINFO structure has to be retrieved using GetDragInfo every time. The address of the retrieved SFTTREE_DRAGINFO structure cannot be considered valid after processing one notification. Some fields in the structure may be modified if the application is currently processing a SFTTREEN_BEGINDRAG or SFTTREEN_DRAGGING notification. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## DragType *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragtype* Defines the [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) detection attribute. C ``` int WINAPI SftTree_GetDragType(HWND hwndCtl); void WINAPI SftTree_SetDragType(HWND hwndCtl, int dragType); int WINAPI SftTreeSplit_GetDragType(HWND hwndCtl); void WINAPI SftTreeSplit_SetDragType(HWND hwndCtl, int dragType); ``` C++ ``` int CSftTree::GetDragType() const; void CSftTree::SetDragType(int dragType); int CSftTreeSplit::GetDragType() const; void CSftTreeSplit::SetDragType(int dragType); ``` ### Parameters hwndCtl The window handle of the tree control. dragType A value describing the drag & drop detection method used: | | | | --- | --- | | SFTTREE_DRAG_LEAVE | The drag & drop operation can start from a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) and is initiated once the mouse cursor leaves the current item. Before an item can be dragged, it has to be selected using the keyboard or the mouse button and the mouse button has to be released, then a drag & drop operation can be started by pressing the mouse button again. | | SFTTREE_DRAG_LEAVEIMM | The drag & drop operation can start from a cell and is initiated once the mouse cursor leaves the current item. An item can be dragged as it is selected in a [single selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree control (see [SFTTREESTYLE_MULTIPLESEL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles)). In a multiple-selection tree, an item has to be selected before it can be dragged (identical to SFTTREE_DRAG_LEAVE). | | SFTTREE_DRAG_LEAVEIMM2 | The drag & drop operation can start from a cell and is initiated once the mouse cursor leaves the current item. An item can be dragged as it is selected in both a single and multiple selection tree control (see SFTTREESTYLE_MULTIPLESEL). | | SFTTREE_DRAG_PIXEL | The drag & drop operation can start from a cell and is initiated once the mouse cursor is moved by a certain pixel distance. Before an item can be dragged, it has to be selected using the keyboard or the mouse button and the mouse button has to be released, then a drag & drop operation can be started by pressing the mouse button again. | | SFTTREE_DRAG_PIXELIMM | The drag & drop operation can start from a cell and is initiated once the mouse cursor is moved by a certain pixel distance. An item can be dragged as it is selected in a single selection tree control (see SFTTREESTYLE_MULTIPLESEL). In a multiple-selection tree, an item has to be selected before it can be dragged (identical to SFTTREE_DRAG_PIXEL). | | SFTTREE_DRAG_PIXELIMM2 | The drag & drop operation can start from a cell and is initiated once the mouse cursor is moved by a certain pixel distance. An item can be dragged as it is selected in both a single and multiple selection tree control (see SFTTREESTYLE_MULTIPLESEL). | ### Returns GetDragType returns a value indicating the current drag & drop detection method used. ### Comments The GetDragType and SetDragType functions define the drag & drop detection attribute. A tree control must be defined using the SFTTREESTYLE_DRAGDROP window style to support drag & drop. SetDragType determines when the [SFTTREEN_BEGINDRAG](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification is generated to notify the application that a drag & drop operation has been initiated by the user. A drag & drop operation always starts at the current location described by [GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex). It is the application's responsibility to visually implement the drag & drop operation. Depending on [SetDragBitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dragbitmaps), dragging can start on the cell only or also on the label and [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap). With some type values, a drag and drop operation starts once the user moves the mouse cursor by a certain pixel distance. The pixel distance used is retrieved by using the Windows API GetSystemMetrics(SM_CX/Y/DRAG). The settings of the [RubberbandSelection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rubberbandselection) property may affect the drag & drop detection. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## DrawInfoCallback *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drawinfocallback* A drawing information callback is provided for compatibility with earlier releases of SftTree only. A [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) or [SetOwnerDrawCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback) should be used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DrawSelectionOutline *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drawselectionoutline* Draws a selection outline. C ``` void WINAPI SftTree_DrawSelectionOutline(HWND hwndCtl, HDC hDC, LPCRECT lpRect, COLORREF OutlineBorder, COLORREF InnerBorder, COLORREF InnerFill1, COLORREF InnerFill2); void WINAPI SftTreeSplit_DrawSelectionOutline(HWND hwndCtl, HDC hDC, LPCRECT lpRect, COLORREF OutlineBorder, COLORREF InnerBorder, COLORREF InnerFill1, COLORREF InnerFill2); ``` C++ ``` void CSftTree::DrawSelectionOutline(HDC hDC, LPCRECT lpRect, COLORREF OutlineBorder, COLORREF InnerBorder, COLORREF InnerFill1, COLORREF InnerFill2) const; void CSftTreeSplit::DrawSelectionOutline(HDC hDC, LPCRECT lpRect, COLORREF OutlineBorder, COLORREF InnerBorder, COLORREF InnerFill1, COLORREF InnerFill2) const; ``` ### Parameters hwndCtl The window handle of the tree control. HDC The device context handle, where the selection outline is to be rendered. lpRect The location and size of the selection outline. OutlineBorder The outermost border color used to render the rounded selection outline rectangle. InnerBorder The inner border color used to render the rounded selection outline rectangle. InnerFill1 The starting color (top) used to gradient fill the inside of the rounded selection outline rectangle. InnerFill2 The ending color (bottom) used to gradient fill the inside of the rounded selection outline rectangle. ### Comments The DrawSelectionOutline function draws a rounded selection outline rectangle. This function is normally only used with ownerdraw [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) (see [OwnerDrawCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DropHighlight *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlight* Defines the current [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) target location. C ``` int WINAPI SftTree_GetDropHighlight(HWND hwndCtl); int WINAPI SftTree_SetDropHighlight(HWND hwndCtl, int index, BOOL fScroll); int WINAPI SftTreeSplit_GetDropHighlight(HWND hwndCtl); int WINAPI SftTreeSplit_SetDropHighlight(HWND hwndCtl, int index, BOOL fScroll); ``` C++ ``` int CSftTree::GetDropHighlight() const; int CSftTree::SetDropHighlight(int index, BOOL fScroll = FALSE); int CSftTreeSplit::GetDropHighlight() const; int CSftTreeSplit::SetDropHighlight(int index, BOOL fScroll = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item which is the new drop target or -1 to clear the current drop target. If [SetDropHighlightStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlightstyle) is set to SFTTREE_DROPHIGHLIGHT_BETWEEN, *index* can be set to the index of the last item +1, which causes the drop target to be displayed beyond the last item. fScroll Set to TRUE to define that items should be scrolled vertically if the drop target *index* is the first or last item currently displayed in the tree control's client area. Set to FALSE to suppress vertical scrolling. ### Returns GetDropHighlight returns the current drop target or -1 if no drop target has been defined. SetDropHighlight returns 0 if the function was successful, otherwise -1 is returned. ### Comments The GetDropHighlight and SetDropHighlight functions define the current drag & drop target location. A tree control must be defined using the [SFTTREESTYLE_DRAGDROP](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) window style to support drag & drop. SetDropHighlight is used to highlight the target of a drag & drop operation. There can be only one drop target at any one time. By calling SetDropHighlight with a new item index, the previous item is no longer a drop target and is no longer highlighted. SetDropHighlightStyle can be used to control the appearance of the target item. Depending on the SetDropHighlightStyle settings, the index specified is the actual drop target or the insertion point. If used as an insertion point, the index value can be set to the number of items in the tree control, which moves the insertion point to the end of the list of items. By setting SetDropHighlight to -1, the current drop target is cleared. A drag & drop operation always starts at the current location (see [GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex)). It is the application's responsibility to visually implement the drag & drop operation. When the operation involves the current tree control, this is accomplished by using [CalcIndexFromPointEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcindexfrompoint) and SetDropHighlight. If dragging to another tree control, CalcIndexFromPointEx and SetDropHighlight have to be used with the target tree control. If dragging to another control type (list box, edit control, etc.), other means may have to be used as implemented by the target control. Once a drag & drop operation ends, SetDropHighlight should be called to clear the drop target by setting index to -1. This removes the highlight indicator from the target item. If SetDropHighlight is set to the first (or last) item currently visible in the tree control's client area, the tree control automatically scrolls up (or down) by one item if * fScroll* is TRUE. This allows a user to drag items to a target item which has to be scrolled into view first. The contents of the tree control will scroll in the given direction until SetDropHighlight is called with * index* set to -1 or with * index* set to an item which is not the first (or last) item visible. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## DropHighlightStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlightstyle* Defines the display attribute of the current [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) target item. C ``` DWORD WINAPI SftTree_GetDropHighlightStyle(HWND hwndCtl); void WINAPI SftTree_SetDropHighlightStyle(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetDropHighlightStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetDropHighlightStyle(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetDropHighlightStyle() const; void CSftTree::SetDropHighlightStyle(DWORD style); DWORD CSftTreeSplit::GetDropHighlightStyle() const; void CSftTreeSplit::SetDropHighlightStyle(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style A value describing the drop target display method used for the current drag & drop target defined using [SetDropHighlight](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlight): | | | | --- | --- | | SFTTREE_DROPHIGHLIGHT_CARET | The drop target is the current item ([GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex)). The current item is updated by each call to SetDropHighlight. The drop target becomes the new current item. The target item is not selected, so even in a [single selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree control (see [SFTTREESTYLE_MULTIPLESEL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles)) index numbers returned by GetCaretIndex and [GetCurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel) are not identical. | | SFTTREE_DROPHIGHLIGHT_ONTOP | The drag & drop target is highlighted using the color defined by the [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors) structure member *colorDropHighlight* (see [SetCtlColors](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors)). The color is used as background color for the target item. The current item is not updated. | | SFTTREE_DROPHIGHLIGHT_BETWEEN | The drag & drop target is highlighted using a solid line drawn using the color defined by the SFTTREE_COLORS structure member *colorDropHighlight* (see SetCtlColors). The line is drawn before the target item, interpreting the value returned by GetDropHighlight as the insertion point. | ### Returns GetDropHighlightStyle returns a value indicating the current drop target display method. ### Comments The GetDropHighlightStyle and SetDropHighlightStyle functions define the display attribute of the current drag & drop target item. A tree control must be defined using the SFTTREESTYLE_DRAGDROP window style to support drag & drop. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## EditColumnRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_editcolumnrect* This function is provided for compatibility with earlier releases of SftTree/DLL. GetEditColumnRect does not support [new features](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_newfeatures) such as [cell merging](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_merging) and should no longer be used. The [GetDisplayCellRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect) function replaces this function. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## EnableSortIndicators *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enablesortindicators* Enables [sort indicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_sortindicator) in [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers). C ``` BOOL WINAPI SftTree_EnableSortIndicators(HWND hwndCtl, BOOL fOn, BOOL fAuto); BOOL WINAPI SftTreeSplit_EnableSortIndicators(HWND hwndCtl, BOOL fOn, BOOL fAuto); ``` C++ ``` BOOL CSftTree::EnableSortIndicators(BOOL fOn, BOOL fAuto); BOOL CSftTreeSplit::EnableSortIndicators(BOOL fOn, BOOL fAuto); ``` ### Parameters hwndCtl The window handle of the tree control. fOn Set to TRUE to enable sort indicators, otherwise set to FALSE. fAuto Set to TRUE to let the tree control handle user interaction automatically for sort indicators, otherwise set to FALSE. If TRUE, the tree control will automatically set and reset sort indicators for all [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) as the user clicks or double-clicks a column header to change the sort order. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments If automatic sort indicator handling is enabled using *fAuto*, the tree control will set and reset sort indicators for all columns as the user clicks or double-clicks a column header to change the sort order. **The tree control will not automatically sort the data.** The [SFTTREEN_LBUTTONDOWN_COLUMN_HEADER](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification can be used by the application to determine when the sort order was changed by the user. In response to this notification, [GetSortColumn1](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortcolumn1) can be used to retrieve the new sort order and sort accordingly, typically using [SortDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), sorting has to be accomplished by adjusting the sort order of the virtual data source. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## EnterResizeMode *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enterresizemode* Allows the user to resize the panes of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) using the keyboard. C ``` void WINAPI SftTreeSplit_EnterResizeMode(HWND hwndCtl); ``` C++ ``` void CSftTreeSplit::EnterResizeMode(); ``` ### Parameters hwndCtl The window handle of the tree control. ### Comments The EnterResizeMode function allows the user to resize the panes of a split tree control using the keyboard. EnterResizeMode is only available for a split tree control. The splitter bar of a split tree control can always be resized by dragging the splitter bar using the mouse. If an application wants to provide a [keyboard interface](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_keyboard), a menu option could be implemented which invokes EnterResizeMode. Once EnterResizeMode is called, the panes of a split tree control can be resized using the left and right arrow keys. Once the user presses the Escape key or moves the mouse cursor away from the splitter bar, the resizing operation ends. While the user resizes the panes, [SFTTREEN_COLUMNSIZE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) events are received by the application. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## Expand *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expand* Expands a [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent). C ``` BOOL WINAPI SftTree_Expand(HWND hwndCtl, int index, BOOL fPreserve, BOOL fDepth); BOOL WINAPI SftTreeSplit_Expand(HWND hwndCtl, int index, BOOL fPreserve, BOOL fDepth); ``` C++ ``` BOOL CSftTree::Expand(int index, BOOL fPreserve = TRUE, BOOL fDepth = FALSE); BOOL CSftTreeSplit::Expand(int index, BOOL fPreserve = TRUE, BOOL fDepth = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item to be expanded. If -1 is specified, all items on level 0 are expanded. fPreserve Set to TRUE to restore the expand/collapse state of [dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) items made visible, as saved by a previous call to [Collapse](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_collapse). If FALSE is specified, only the item defined by *index* is expanded and immediate dependents are made visible but remain collapsed. fDepth Set to TRUE to expand all dependent items, including non-immediate dependent items. If TRUE is specified, *fPreserve* is ignored as all dependents are expanded. ### Returns The return value is TRUE if successful, otherwise FALSE is returned. ### Comments The Expand function expands a parent item. Expand expands all dependent items of item * index* and restores the expand/collapse state of all dependent items, as saved by a previous call to Collapse. If an item is already expanded when using Expand, the item remains unchanged. It does not make any indirect dependents visible. To make sure that an item's indirect dependents are shown, use Collapse first, which collapses the item (and all dependents), followed by Expand. Now all dependents are visible. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ExpandCollapseButtonRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapsebuttonrect* Returns the location of an item's [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons). C ``` void WINAPI SftTree_GetExpandCollapseButtonRect(HWND hwndCtl, int index, LPRECT lpRect); void WINAPI SftTreeSplit_GetExpandCollapseButtonRect(HWND hwndCtl, int index, LPRECT lpRect); ``` C++ ``` void CSftTree::GetExpandCollapseButtonRect(int index, LPRECT lpRect) const; void CSftTreeSplit::GetExpandCollapseButtonRect(int index, LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the expand/collapse button position is to be retrieved. lpRect A pointer to a RECT structure where the location of the expand/collapse button is returned (in pixels). ### Returns GetExpandCollapseButtonRect returns TRUE if successful, otherwise FALSE is returned. ### Comments The GetExpandCollapseButtonRect function returns the location of an item's expand/collapse button. If an item doesn't have an expand/collapse button, because it is a [leaf item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_leaf) or because the expand/collapse button is suppressed, an empty rectangle is returned in *lpRect*. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ExpandCollapseIndex *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapseindex* Returns the zero-based index of the item to expand/collapse. C ``` int WINAPI SftTree_GetExpandCollapseIndex(HWND hwndCtl); int WINAPI SftTreeSplit_GetExpandCollapseIndex(HWND hwndCtl); ``` C++ ``` int CSftTree::GetExpandCollapseIndex() const; int CSftTreeSplit::GetExpandCollapseIndex() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns GetExpandCollapseIndex returns the zero-based index of the item to expand/collapse. ### Comments The GetExpandCollapseIndex function returns the zero-based index of the item to expand/collapse. GetExpandCollapseIndex is used while handling [notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) such as SFTTREEN_AUTOEXPANDING, SFTTREEN_LBUTTONDOWN_BUTTON, etc., to determine which item to expand or collapse. GetExpandCollapseIndex returns the same value as [GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex) (i.e., the current item) unless [SetUpdateCaretExpandCollapse](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_updatecaretexpandcollapse)(FALSE) was used to initialize the tree control. In this case, GetExpandCollapseIndex returns the index of the item whose [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) was (double-)clicked. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## FindItem *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_finditem* Searches item data. C ``` int WINAPI SftTree_FindItem(HWND hwndCtl, int index, SFTTREE_DWORD_PTR item); int WINAPI SftTreeSplit_FindItem(HWND hwndCtl, int index, SFTTREE_DWORD_PTR item); ``` C++ ``` int CSftTree::FindItem(int index, SFTTREE_DWORD_PTR item) const; int CSftTreeSplit::FindItem(int index, SFTTREE_DWORD_PTR item) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item where the search for the specified data is to begin. item The value to be searched. ### Returns The return value is the zero-based index of the item where the item data was found. -1 is returned if the item data was not found or an error occurred. ### Comments The FindItem function searches item data. The value of *item* is compared to the value returned by [GetItemData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata) for each item starting at *index*. If a matching value is found, its zero-based index is returned, otherwise -1 is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FindString *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstring* Searches a string. C ``` int SftTree_FindStringCol(HWND hwndCtl, int index, int realCol, LPCTSTR lpszText); int SftTree_FindString(HWND hwndCtl, int index, LPCTSTR lpszText); int WINAPI SftTree_FindString_A(HWND hwndCtl, int index, LPCSTR lpszText); int WINAPI SftTree_FindString_W(HWND hwndCtl, int index, LPCWSTR lpszText); int SftTreeSplit_FindStringCol(HWND hwndCtl, int index, int realCol, LPCTSTR lpszText); int SftTreeSplit_FindString(HWND hwndCtl, int index, LPCTSTR lpszText); int WINAPI SftTreeSplit_FindString_A(HWND hwndCtl, int index, LPCSTR lpszText); int WINAPI SftTreeSplit_FindString_W(HWND hwndCtl, int index, LPCWSTR lpszText); ``` C++ ``` int CSftTree::FindString(int index, int realCol, CString& string) const; int CSftTree::FindString(int index, CString& string) const; int CSftTree::FindString(int index, int realCol, LPCTSTR lpszText) const; int CSftTree::FindString(int index, LPCTSTR lpszText) const; int CSftTreeSplit::FindString(int index, int realCol, CString& string) const; int CSftTreeSplit::FindString(int index, CString& string) const; int CSftTreeSplit::FindString(int index, int realCol, LPCTSTR lpszText) const; int CSftTreeSplit::FindString(int index, LPCTSTR lpszText) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item where the search for the specified string is to begin. realCol The zero-based column number to be searched. lpszText The string to be searched. string The string to be searched. ### Returns The return value is the zero-based index of the item where the string was found. -1 is returned if the string was not found or an error occurred. ### Comments The FindString function searches a string. The column text searched is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. The string *lpszString* is compared to the value returned by [GetText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text) for each item starting at *index*. The search starts at the item described by *index* and is restricted to the column specified by *realCol*. If an item with matching text is found, its zero-based index is returned, otherwise -1 is returned. Only one column can be searched at a time. The comparison of *lpszString* and the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) is not case sensitive. If the cell text starts with the string in *lpszString*, it is considered a match. To find an exact match for *lpszString* use [FindStringExact](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringexact). The [FindStringEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringex) function can also be used and allows additional search options. | SearchString | Cell Text | Match | Comment | | --- | --- | --- | --- | | ABC | abc | Yes | Same string, case is ignored | | abc | abc123 | Yes | Starts with *lpszString* | | abc | Thisabc | No | Doesn't start with *lpszString* | | abc | ab | No | Doesn't contain the complete *lpszString* | See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FindStringEx *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringex* Searches [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) for a string. C ``` int WINAPI SftTree_FindStringEx(HWND hwndCtl, int index, int endIndex, int realCol, int level, LPCTSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact, BOOL fSearchEnabledOnly, BOOL fSearchVisibleOnly, int* FoundIndex, int* FoundColumn); int WINAPI SftTree_FindStringEx_W(HWND hwndCtl, int index, int endIndex, int realCol, int level, LPCWSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact, BOOL fSearchEnabledOnly, BOOL fSearchVisibleOnly, int* FoundIndex, int* FoundColumn); int WINAPI SftTree_FindStringEx_A(HWND hwndCtl, int index, int endIndex, int realCol, int level, LPCSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact, BOOL fSearchEnabledOnly, BOOL fSearchVisibleOnly, int* FoundIndex, int* FoundColumn); int WINAPI SftTreeSplit_FindStringEx(HWND hwndCtl, int index, int endIndex, int realCol, int level, LPCTSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact, BOOL fSearchEnabledOnly, BOOL fSearchVisibleOnly, int* FoundIndex, int* FoundColumn); int WINAPI SftTreeSplit_FindStringEx_W(HWND hwndCtl, int index, int endIndex, int realCol, int level, LPCWSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact, BOOL fSearchEnabledOnly, BOOL fSearchVisibleOnly, int* FoundIndex, int* FoundColumn); int WINAPI SftTreeSplit_FindStringEx_A(HWND hwndCtl, int index, int endIndex, int realCol, int level, LPCSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact, BOOL fSearchEnabledOnly, BOOL fSearchVisibleOnly, int* FoundIndex, int* FoundColumn); ``` C++ ``` int CSftTree::FindStringEx(int index, int endIndex, int realCol, int level, LPCTSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact, BOOL fSearchEnabledOnly, BOOL fSearchVisibleOnly, int* FoundIndex, int* FoundColumn) const; int CSftTreeSplit::FindStringEx(int index, int endIndex, int realCol, int level, LPCTSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact, BOOL fSearchEnabledOnly, BOOL fSearchVisibleOnly, int* FoundIndex, int* FoundColumn) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based item index after which the search begins (non-inclusive). If -1 is specified, the search starts at the first item (index 0). endIndex The zero-based item index where the search ends (inclusive). If -1 is specified, all items are searched. realCol The zero-based column number. The [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) for cells in this column are searched. If -1 is specified, all [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) are searched. level The item level to search. Only items on this level (see [ItemLevel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel)) are searched. If -1 is specified, all levels are searched. lpszText The text to search. fWrap If set to TRUE, the search starts at *index* and wraps around (if necessary) and ends at *endIndex*, otherwise the search does not wrap around and ends at *endIndex*. fIgnoreCase If set to TRUE, the string comparison between cell text and *lpszText* is not case sensitive. If FALSE, comparison is case sensitive. fExact If set to TRUE, the cell text must be exactly the same as *lpszText*, otherwise the cell text must start with the string *lpszText*. fSearchEnabledOnly If set to TRUE, only enabled items (see [ItemStatus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemstatus)) are searched, otherwise all items regardless of their status are searched. fSearchVisibleOnly If set to TRUE, only visible child items (expanded branches) are searched, otherwise all items are searched. FoundIndex A pointer to an integer where the zero-based index of the item where the string was found is returned. Can be set to NULL. FoundColumn A pointer to an integer where the zero-based column number of the cell where the string was found is returned. Can be set to NULL. ### Returns The return value is the zero-based index of the item where the string was found. -1 is returned if the string was not found or an error occurred. ### Comments The FindStringEx function searches cells for a string. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FindStringExact *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringexact* Searches a string. C ``` int SftTree_FindStringColExact(HWND hwndCtl, int index, int realCol, LPCTSTR lpszText); int SftTree_FindStringExact(HWND hwndCtl, int index, LPCTSTR lpszText); int WINAPI SftTree_FindStringExact_A(HWND hwndCtl, int index, LPCSTR lpszText); int WINAPI SftTree_FindStringExact_W(HWND hwndCtl, int index, LPCWSTR lpszText); int SftTreeSplit_FindStringColExact(HWND hwndCtl, int index, int realCol, LPCTSTR lpszText); int SftTreeSplit_FindStringExact(HWND hwndCtl, int index, LPCTSTR lpszText); int WINAPI SftTreeSplit_FindStringExact_A(HWND hwndCtl, int index, LPCSTR lpszText); int WINAPI SftTreeSplit_FindStringExact_W(HWND hwndCtl, int index, LPCWSTR lpszText); ``` C++ ``` int CSftTree::FindStringExact(int index, int realCol, CString& string) const; int CSftTree::FindStringExact(int index, CString& string) const; int CSftTree::FindStringExact(int index, int realCol, LPCTSTR lpszText) const; int CSftTree::FindStringExact(int index, LPCTSTR lpszText) const; int CSftTreeSplit::FindStringExact(int index, int realCol, CString& string) const; int CSftTreeSplit::FindStringExact(int index, CString& string) const; int CSftTreeSplit::FindStringExact(int index, int realCol, LPCTSTR lpszText) const; int CSftTreeSplit::FindStringExact(int index, LPCTSTR lpszText) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item where the search for the specified string is to begin. realCol The zero-based column number to be searched. lpszText The string to be searched. string The string to be searched. ### Returns The return value is the zero-based index of the item where the string was found. -1 is returned if the string was not found or an error occurred. ### Comments The FindStringExact function searches a string. The column text searched is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. The string *lpszString* is compared to the value returned by [GetText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text) for each item starting at *index*. The search starts at the item described by *index* and is restricted to the column specified by *realCol*. If an item with exactly matching text is found, its zero-based index is returned, otherwise -1 is returned. Only one column can be searched at a time. The comparison of *lpszString* and the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) is not case sensitive. If the cell text is identical to the string in *lpszString*, it is considered a match. To find a loose match for *lpszString* use [FindString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstring). The [FindStringEx](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringex) function can also be used and allows additional search options. | SearchString | Cell Text | Match | Comment | | --- | --- | --- | --- | | ABC | abc | Yes | Same string, case is ignored | | abc | abc123 | No | Not the same string | | abc | Thisabc | No | Not the same string | | abc | ab | No | Not the same string | See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FirstDisplayColumn *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_firstdisplaycolumn* Returns the index of the first displayed column. C ``` int WINAPI SftTree_GetFirstDisplayColumn(HWND hwndCtl); int WINAPI SftTreeSplit_GetFirstDisplayColumn(HWND hwndCtl, BOOL fLeft); ``` C++ ``` int CSftTree::GetFirstDisplayColumn() const; int CSftTreeSplit::GetFirstDisplayColumn(BOOL fLeft = TRUE) const; ``` ### Parameters hwndCtl The window handle of the tree control. fLeft Set to TRUE to retrieve the column number of the first displayed column on the left side of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) (the portion of the tree control containing the hierarchy). If FALSE is specified, the column number of the first displayed column on the right side is returned. ### Returns GetFirstDisplayColumn returns the zero-based [display column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) of the first displayed column. ### Comments The GetFirstDisplayColumn function returns the index of the first displayed column. The first column with a width greater than 0 (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex)) is considered the first displayed column. It is not necessarily displayed or visible if [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling) is in effect. A column can be made visible using [MakeCellVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecellvisible) or [MakeColumnVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnvisible). The last displayed column can be determined using [GetLastDisplayColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_lastdisplaycolumn). While most other functions use real column numbers, GetFirstDisplayColumn returns the display column number of the first displayed column. The display column number can be translated to a real column number using [GetRealColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_realcolumn). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Flyby *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_flyby* Defines whether [flyby highlighting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_flyby_highlighting) is enabled. > GetFlyby and SetFlyby are provided for compatibility with SftTree/DLL 6.0 and earlier only. Applications should use [SFTTREE_CONTROL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control), iFlybyStyle instead. C ``` BOOL WINAPI SftTree_GetFlyby(HWND hwndCtl); void WINAPI SftTree_SetFlyby(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetFlyby(HWND hwndCtl); void WINAPI SftTreeSplit_SetFlyby(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetFlyby() const; void CSftTree::SetFlyby(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetFlyby() const; void CSftTreeSplit::SetFlyby(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to enable flyby highlighting or FALSE to disable. ### Returns GetFlyby returns TRUE if flyby highlighting is enabled, otherwise FALSE is returned. ### Comments > GetFlyby and SetFlyby are provided for compatibility with SftTree/DLL 6.0 and earlier only. Applications should use SFTTREE_CONTROL, iFlybyStyle instead. The GetFlyby and SetFlyby functions define whether flyby highlighting is enabled. Flyby highlighting can be useful when multiple [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) without [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines) are shown. The user receives immediate feedback when the mouse cursor moves over an item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FlybyIndex *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_flybyindex* Returs the index of the highlighted item for [flyby highlighting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_flyby_highlighting). C ``` int WINAPI SftTree_GetFlybyIndex(HWND hwndCtl); int WINAPI SftTreeSplit_GetFlybyIndex(HWND hwndCtl); ``` C++ ``` int CSftTree::GetFlybyIndex() const; int CSftTreeSplit::GetFlybyIndex() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns GetFlybyIndex returns the zero-based index of the highlighted item for flyby highlighting. The value -1 is returned if no item is highlighted. ### Comments This could be used to update applicaction-specific status information outside of the tree control as the mouse cursor hovers over [tree items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_items). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Footer *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footer* Defines a column's footer text. C ``` int SftTree_GetFooterCol(HWND hwndCtl, int realCol, LPTSTR lpszBuffer, int cbMax); int SftTree_GetFooter(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetFooter_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetFooter_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); BOOL SftTree_SetFooterCol(HWND hwndCtl, int realCol, LPCTSTR lpszText); BOOL SftTree_SetFooter(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTree_SetFooter_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTree_SetFooter_W(HWND hwndCtl, LPCWSTR lpszText); int SftTreeSplit_GetFooterCol(HWND hwndCtl, int realCol, LPTSTR lpszBuffer, int cbMax); int SftTreeSplit_GetFooter(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetFooter_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetFooter_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); BOOL SftTreeSplit_SetFooterCol(HWND hwndCtl, int realCol, LPCTSTR lpszText); BOOL SftTreeSplit_SetFooter(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTreeSplit_SetFooter_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTreeSplit_SetFooter_W(HWND hwndCtl, LPCWSTR lpszText); ``` C++ ``` void CSftTree::GetFooter(int realCol, CString& string) const; void CSftTree::GetFooter(CString& string) const; int CSftTree::GetFooter(int realCol, LPTSTR lpszBuffer, int cbMax) const; int CSftTree::GetFooter(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTree::SetFooter(int realCol, LPCTSTR lpszText); BOOL CSftTree::SetFooter(LPCTSTR lpszText); void CSftTreeSplit::GetFooter(int realCol, CString& string) const; void CSftTreeSplit::GetFooter(CString& string) const; int CSftTreeSplit::GetFooter(int realCol, LPTSTR lpszBuffer, int cbMax) const; int CSftTreeSplit::GetFooter(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTreeSplit::SetFooter(int realCol, LPCTSTR lpszText); BOOL CSftTreeSplit::SetFooter(LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose text is to be retrieved or set. lpszBuffer A pointer to a buffer where the footer text will be returned (GetFooter) or a buffer containing the new footer text (SetFooter). string A reference to a CString object where the footer text will be returned. cbMax The maximum number of characters to be returned in the buffer pointed to by *lpszBuffer*, including the terminating '\0'. ### Returns GetFooter (GetFooterCol) returns the number of characters returned in the buffer, not including the terminating '\0'. If the buffer is too small to receive the complete footer text, the text is truncated. -1 is returned if an error occurred. SetFooter (SetFooterCol) returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetFooter and SetFooter functions define a column's footer text. The footer text set or retrieved is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. Footer text can contain multiple lines of text using cr-lf (\r\n). [SetMultilineFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilinefooter) must be used to enable multiple lines of text. The SetFooter function cannot be used to add more text lines than the footer already contains. When increasing the number of text lines, the [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) function must be used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FooterButton *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerbutton* Defines the column number of the currently pressed [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) button. C ``` int WINAPI SftTree_GetFooterButton(HWND hwndCtl); BOOL WINAPI SftTree_SetFooterButton(HWND hwndCtl, int realCol); int WINAPI SftTreeSplit_GetFooterButton(HWND hwndCtl); BOOL WINAPI SftTreeSplit_SetFooterButton(HWND hwndCtl, int realCol); ``` C++ ``` int CSftTree::GetFooterButton() const; void CSftTree::SetFooterButton(int realCol); int CSftTreeSplit::GetFooterButton() const; void CSftTreeSplit::SetFooterButton(int realCol); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number specifying which footer button to set to the "down" state. This value can be -1, which causes all footer buttons to go to their "up" state. ### Returns GetFooterButton returns the zero-based column number of the column footer button currently pressed down or -1 if no button is pressed down. ### Comments The GetFooterButton and SetFooterButton functions define the column number of the currently pressed column footer button. Only one column footer button can be down at any one time. A column footer button can be pressed by the user or under program control using SetFooterButton. Once pressed, the new button will remain in its down state until another button is pressed or until SetFooterButton sets a new (or no) button. If the column title style is defined using SFTTREE_HEADER_UP, the footer button automatically returns to its "up" position when clicked (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FooterFont *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerfont* Defines the font used for [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) text display. C ``` HFONT WINAPI SftTree_GetFooterFont(HWND hwndCtl); void WINAPI SftTree_SetFooterFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw); HFONT WINAPI SftTreeSplit_GetFooterFont(HWND hwndCtl); void WINAPI SftTreeSplit_SetFooterFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw); ``` C++ ``` CFont* CSftTree::GetFooterFont() const; void CSftTree::SetFooterFont(CFont* pFont, BOOL fRedraw = TRUE); CFont* CSftTreeSplit::GetFooterFont() const; void CSftTreeSplit::SetFooterFont(CFont* pFont, BOOL fRedraw = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. hFont The font handle describing the new font to be used to draw the column footer and [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) text. pFont A pointer to a CFont object describing the new font to be used to draw the column footer and row/column footer text. fRedraw Set to TRUE to cause the tree control to be repainted immediately, otherwise set to FALSE. ### Returns GetFooterFont returns the font used to draw the footer text. ### Comments The GetFooterFont and SetFooterFont functions define the font used for column footer text display. The application retains ownership of the font and cannot delete the font until the tree control no longer uses the font (usually until the tree control is destroyed or the font is changed using SetFooterFont). To change the font used for item text, use the WM_SETFONT message (CWnd::SetFont). The WM_SETFONT message overrides the font defined using SetFooterFont. If the footer font needs to be changed, it must be changed after using the WM_SETFONT message. The CFont* pointer returned by GetFooterFont may point to a temporary object and should not be stored for later use. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FooterLength *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerlength* Returns the length of a column's footer text. C ``` int WINAPI SftTree_GetFooterLength(HWND hwndCtl); int SftTree_GetFooterColLength(HWND hwndCtl, int realCol); int WINAPI SftTreeSplit_GetFooterLength(HWND hwndCtl); int SftTreeSplit_GetFooterColLength(HWND hwndCtl, int realCol); ``` C++ ``` int CSftTree::GetFooterLen() const; int CSftTree::GetFooterLen(int realCol) const; int CSftTreeSplit::GetFooterLen() const; int CSftTreeSplit::GetFooterLen(int realCol) const; ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose text length is to be retrieved. ### Returns GetFooterLen returns the length of the specified column's footer text in characters, not including the terminating '\0' or -1 if an error occurred. ### Comments The GetFooterLength function returns the length of a column's footer text. The footer text length retrieved is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FooterRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footerrect* Returns the dimensions of the [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) area. C ``` void WINAPI SftTree_GetFooterRect(HWND hwndCtl, int iCol, LPRECT lpRect); void WINAPI SftTreeSplit_GetFooterRect(HWND hwndCtl, int iCol, LPRECT lpRect); ``` C++ ``` void CSftTree::GetFooterRect(int iCol, LPRECT lpRect) const; void CSftTreeSplit::GetFooterRect(int iCol, LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. iCol The zero-based column number whose location is to be retrieved. If -1 is specified, the location of the entire column footer area is returned. lpRect A pointer to a RECT structure where the location of the requested column footer is returned. ### Comments The GetFooterRect function returns the dimensions of the column footer area. GetFooterRect does not handle merged column footers. If [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) or column merging is used, [GetDisplayFooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayfooterrect) should be used instead. An empty rectangle is returned if an invalid column number is specified or column footers are not shown (see [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). The coordinates returned in *lpRect* are coordinates relative to the tree control's client area (in pixels). The [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) area can be retrieved using [GetRowColFooterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterrect). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ForwardChildMsgs *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_forwardchildmsgs* Defines the child window message handling status. C ``` BOOL WINAPI SftTree_GetForwardChildMsgs(HWND hwndCtl); void WINAPI SftTree_SetForwardChildMsgs(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetForwardChildMsgs(HWND hwndCtl); void WINAPI SftTreeSplit_SetForwardChildMsgs(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetForwardChildMsgs() const; void CSftTree::SetForwardChildMsgs(BOOL fSet); BOOL CSftTreeSplit::GetForwardChildMsgs() const; void CSftTreeSplit::SetForwardChildMsgs(BOOL fSet); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE so messages received for a tree control's child windows are forwarded to the tree control's parent window, otherwise set to FALSE. ### Returns GetForwardChildMsgs returns TRUE if messages for a child window are forwarded to the tree control's parent window, otherwise FALSE is returned. ### Comments The GetForwardChildMsgs and SetForwardChildMsgs functions define the child window message handling status. Child windows can be created by an application and attached to a tree control by specifying the tree control as the owner of the child window. Child controls created in this manner are usually used for [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). Child window messages are normally forwarded to the parent window of the tree control, so an application can implement all event handlers in the parent window. If an application handles child control messages by subclassing the control or in a derived C++ class (which implicitly subclasses the window), these child messages need not be forwarded to the tree control's parent window. SetForwardChildMsgs can be used to suppress messages to be sent to the parent window, eliminating some of the overhead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FreeGDIPlusImageLoadedFromFile *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_freegdiplusimageloadedfromfile* Deletes a [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) image obtained using [SftTree_LoadGDIPlusImageFromFile](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_loadgdiplusimagefromfile). C ``` void SftTree_FreeGDIPlusImageLoadedFromFile(LPVOID pGDIPlusImage); ``` ### Parameters pGDIPlusImage A Gdiplus::Image pointer to be deleted. This value is usually obtained from a preceding call to SftTree_LoadGDIPlusImageFromFile. ### Comments Deletes a GDI+ image obtained using SftTree_LoadGDIPlusImageFromFile. This function is mainly intended for applications written [using C](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_usingc). Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use delete to free a GDI+ image object. Using SftTree_FreeGDIPlusImageLoadedFromFile even C applications can use GDI+ images, without needing access to GDI+ itself. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## FreeGDIPlusImageLoadedFromResource *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_freegdiplusimageloadedfromresource* Deletes a [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) image obtained using [SftTree_LoadGDIPlusImageFromResource](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_loadgdiplusimagefromresource). C ``` void SftTree_FreeGDIPlusImageLoadedFromResource(LPVOID pGDIPlusImage); ``` ### Parameters pGDIPlusImage A Gdiplus::Image pointer to be deleted. This value is usually obtained from a preceding call to SftTree_LoadGDIPlusImageFromResource. ### Comments Deletes a GDI+ image obtained using SftTree_LoadGDIPlusImageFromResource. This function is mainly intended for applications written [using C](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_usingc). Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use delete to free a GDI+ image object. Using SftTree_FreeGDIPlusImageLoadedFromResource even C applications can use GDI+ images, without needing access to GDI+ itself. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## GDIPlusAvailable *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_gdiplusavailable* Returns whether [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) support is available. C ``` BOOL WINAPI SftTree_GetGDIPlusAvailable(HWND hwndCtl); BOOL WINAPI SftTreeSplit_GetGDIPlusAvailable(HWND hwndCtl); ``` C++ ``` BOOL CSftTree::GetGDIPlusAvailable() const; BOOL CSftTreeSplit::GetGDIPlusAvailable() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns GetGDIPlusAvailable returns TRUE if GDI+ is available on the current system, otherwise FALSE is returned. ### Comments The GetGDIPlusAvailable function returns whether GDI+ support is available. In order to use GDI+ images (see [Sft_SetPictureGDIPlusImage](https://softelvdm.com/Documentation/SftPicture2/Topic/function_setpicturegdiplusimage)), GDI+ support must be available. For information about distributing GDI+ with your application, please see "[Distributing the Dlls](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_distributing)". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## GridStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_gridstyle* Defines the grid line display style. C ``` int WINAPI SftTree_GetGridStyle(HWND hwndCtl); void WINAPI SftTree_SetGridStyle(HWND hwndCtl, int style); int WINAPI SftTreeSplit_GetGridStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetGridStyle(HWND hwndCtl, int style); ``` C++ ``` int CSftTree::GetGridStyle() const; void CSftTree::SetGridStyle(int type = SFTTREE_GRID_VERT); int CSftTreeSplit::GetGridStyle() const; void CSftTreeSplit::SetGridStyle(int type = SFTTREE_GRID_VERT); ``` ### Parameters hwndCtl The window handle of the tree control. style A value describing the [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines) displayed. | | | | --- | --- | | SFTTREE_GRID_VERT | Vertical grid lines are drawn around [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) using a solid line. | | SFTTREE_GRID_HORZ | Horizontal grid lines are drawn around items using a solid line. | | SFTTREE_GRID_BOTH | Vertical and horizontal grid lines are drawn using a solid line. | | SFTTREE_GRID_VERT_DOT | Vertical grid lines are drawn around columns using a dotted line. | | SFTTREE_GRID_HORZ_DOT | Horizontal grid lines are drawn around items using a dotted line. | | SFTTREE_GRID_BOTH_DOT | Vertical and horizontal grid lines are drawn using a dotted line. | ### Returns GetGridStyle returns the current grid line display style. ### Comments The GetGridStyle and SetGridStyle functions define the grid line display style. The color used for grid lines can be defined using [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors), *colorGridVert* and *colorGridHorz*. If grid lines are not shown (see [SetShowGrid](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showgrid)), this function has no effect. Horizontal grid lines are not drawn if items are drawn using a 3D display method (see [SetShow3D](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_show3d)). Vertical grid lines are not drawn if all [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) have no header text and footer text (except for the first column) and all [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) are marked for [cell merging](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_merging), in which case all cells are handled as one (visually) contiguous cell, even if each cell has individual [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text). When printing or previewing the tree control contents using SftPrintPreview/DLL, solid grid lines are used, even if dotted grid lines are defined using SFTTREE_GRID_VERT_DOT, SFTTREE_GRID_HORZ_DOT or SFTTREE_GRID_BOTH_DOT. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Header *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_header* Defines a column's header text. C ``` int SftTree_GetHeaderCol(HWND hwndCtl, int realCol, LPTSTR lpszBuffer, int cbMax); int SftTree_GetHeader(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetHeader_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetHeader_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); BOOL SftTree_SetHeaderCol(HWND hwndCtl, int realCol, LPCTSTR lpszText); BOOL SftTree_SetHeader(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTree_SetHeader_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTree_SetHeader_W(HWND hwndCtl, LPCWSTR lpszText); int SftTreeSplit_GetHeaderCol(HWND hwndCtl, int realCol, LPTSTR lpszBuffer, int cbMax); int SftTreeSplit_GetHeader(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetHeader_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetHeader_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); BOOL SftTreeSplit_SetHeaderCol(HWND hwndCtl, int realCol, LPCTSTR lpszText); BOOL SftTreeSplit_SetHeader(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTreeSplit_SetHeader_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTreeSplit_SetHeader_W(HWND hwndCtl, LPCWSTR lpszText); ``` C++ ``` void CSftTree::GetHeader(int realCol, CString& string) const; void CSftTree::GetHeader(CString& string) const; int CSftTree::GetHeader(int realCol, LPTSTR lpszBuffer, int cbMax) const; int CSftTree::GetHeader(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTree::SetHeader(int realCol, LPCTSTR lpszText); BOOL CSftTree::SetHeader(LPCTSTR lpszText); void CSftTreeSplit::GetHeader(int realCol, CString& string) const; void CSftTreeSplit::GetHeader(CString& string) const; int CSftTreeSplit::GetHeader(int realCol, LPTSTR lpszBuffer, int cbMax) const; int CSftTreeSplit::GetHeader(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTreeSplit::SetHeader(int realCol, LPCTSTR lpszText); BOOL CSftTreeSplit::SetHeader(LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose text is to be retrieved or set. lpszBuffer A pointer to a buffer where the header text will be returned (GetHeader) or a buffer containing the new header text (SetHeader). string A reference to a CString object where the header text will be returned. cbMax The maximum number of characters to be returned in the buffer pointed to by *lpszBuffer*, including the terminating '\0'. ### Returns GetHeader (GetHeaderCol) returns the number of characters returned in the buffer, not including the terminating '\0'. If the buffer is too small to receive the complete header text, the text is truncated. -1 is returned if an error occurred. SetHeader (SetHeaderCol) returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetHeader and SetHeader functions define a column's header text. The header text set or retrieved is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. Header text can contain multiple lines of text using cr-lf (\r\n). [SetMultilineHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilineheader) must be used to enable multiple lines of text. The SetHeader function cannot be used to add more text lines than the header already contains. When increasing the number of text lines, the [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) function must be used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## HeaderButton *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerbutton* Defines the column number of the currently pressed [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) button. C ``` int WINAPI SftTree_GetHeaderButton(HWND hwndCtl); BOOL WINAPI SftTree_SetHeaderButton(HWND hwndCtl, int realCol); int WINAPI SftTreeSplit_GetHeaderButton(HWND hwndCtl); BOOL WINAPI SftTreeSplit_SetHeaderButton(HWND hwndCtl, int realCol); ``` C++ ``` int CSftTree::GetHeaderButton() const; void CSftTree::SetHeaderButton(int realCol); int CSftTreeSplit::GetHeaderButton() const; void CSftTreeSplit::SetHeaderButton(int realCol); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number specifying which header button to set to the "down" state. This value can be -1, which causes all header buttons to go to their "up" state. ### Returns GetHeaderButton returns the zero-based column number of the column header button currently pressed down or -1 if no button is pressed down. ### Comments The GetHeaderButton and SetHeaderButton functions define the column number of the currently pressed column header button. Only one column header button can be down at any one time. A column header button can be pressed by the user or under program control using SetHeaderButton. Once pressed, the new button will remain in its down state until another button is pressed or until SetHeaderButton sets a new (or no) button. If the column title style is defined using SFTTREE_HEADER_UP, the header button automatically returns to its "up" position when clicked (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## HeaderFont *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerfont* Defines the font used for [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) text display. C ``` HFONT WINAPI SftTree_GetHeaderFont(HWND hwndCtl); void WINAPI SftTree_SetHeaderFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw); HFONT WINAPI SftTreeSplit_GetHeaderFont(HWND hwndCtl); void WINAPI SftTreeSplit_SetHeaderFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw); ``` C++ ``` CFont* CSftTree::GetHeaderFont() const; void CSftTree::SetHeaderFont(CFont* pFont, BOOL fRedraw = TRUE); CFont* CSftTreeSplit::GetHeaderFont() const; void CSftTreeSplit::SetHeaderFont(CFont* pFont, BOOL fRedraw = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. hFont The font handle describing the new font to be used to draw the column header and [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) text. pFont A pointer to a CFont object describing the new font to be used to draw the column header and row/column header text. fRedraw Set to TRUE to cause the tree control to be repainted immediately, otherwise set to FALSE. ### Returns GetHeaderFont returns the font used to draw the header text. ### Comments The GetHeaderFont and SetHeaderFont functions define the font used for column header text display. The application retains ownership of the font and cannot delete the font until the tree control no longer uses the font (usually until the tree control is destroyed or the font is changed using SetHeaderFont). To change the font used for item text, use the WM_SETFONT message (CWnd::SetFont). The WM_SETFONT message overrides the font defined using SetHeaderFont. If the header font needs to be changed, it must be changed after using the WM_SETFONT message. The CFont* pointer returned by GetHeaderFont may point to a temporary object and should not be stored for later use. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## HeaderLength *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerlength* Returns the length of a column's header text. C ``` int WINAPI SftTree_GetHeaderLength(HWND hwndCtl); int SftTree_GetHeaderColLength(HWND hwndCtl, int realCol); int WINAPI SftTreeSplit_GetHeaderLength(HWND hwndCtl); int SftTreeSplit_GetHeaderColLength(HWND hwndCtl, int realCol); ``` C++ ``` int CSftTree::GetHeaderLen() const; int CSftTree::GetHeaderLen(int realCol) const; int CSftTreeSplit::GetHeaderLen() const; int CSftTreeSplit::GetHeaderLen(int realCol) const; ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number whose text length is to be retrieved. ### Returns GetHeaderLen returns the length of the specified column's header text in characters, not including the terminating '\0' or -1 if an error occurred. ### Comments The GetHeaderLength function returns the length of a column's header text. The header text length retrieved is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## HeaderRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_headerrect* Returns the dimensions of the [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) area. C ``` void WINAPI SftTree_GetHeaderRect(HWND hwndCtl, int iCol, LPRECT lpRect); void WINAPI SftTreeSplit_GetHeaderRect(HWND hwndCtl, int iCol, LPRECT lpRect); ``` C++ ``` void CSftTree::GetHeaderRect(int iCol, LPRECT lpRect) const; void CSftTreeSplit::GetHeaderRect(int iCol, LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. iCol The zero-based column number whose location is to be retrieved. If -1 is specified, the location of the entire column header area is returned. lpRect A pointer to a RECT structure where the location of the requested column header is returned. ### Comments The GetHeaderRect function returns the dimensions of the column header area. GetHeaderRect does not handle merged column headers. If [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) or column merging is used, [GetDisplayHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displayheaderrect) should be used instead. An empty rectangle is returned if an invalid column number is specified or column headers are not shown (see [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). The coordinates returned in *lpRect* are coordinates relative to the tree control's client area (in pixels). The [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) area can be retrieved using [GetRowColHeaderRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderrect). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## HighContrastMode *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_highcontrast* Defines whether the tree control honors the [Windows High Contrast](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_highcontrast) [accessibility](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_accessibility) setting. C ``` void WINAPI SftTree_SetHighContrastMode(HWND hwndCtl, int mode); int WINAPI SftTree_GetHighContrastMode(HWND hwndCtl); BOOL WINAPI SftTree_IsHighContrastActive(HWND hwndCtl); void WINAPI SftTreeSplit_SetHighContrastMode(HWND hwndCtl, int mode); int WINAPI SftTreeSplit_GetHighContrastMode(HWND hwndCtl); BOOL WINAPI SftTreeSplit_IsHighContrastActive(HWND hwndCtl); ``` C++ ``` void CSftTree::SetHighContrastMode(int mode); int CSftTree::GetHighContrastMode() const; BOOL CSftTree::IsHighContrastActive() const; void CSftTreeSplit::SetHighContrastMode(int mode); int CSftTreeSplit::GetHighContrastMode() const; BOOL CSftTreeSplit::IsHighContrastActive() const; ``` ### Parameters hwndCtl The window handle of the tree control. mode Defines the high contrast mode setting. *mode* can be one of the following values: | | | | --- | --- | | SFTTREE_HIGHCONTRAST_OFF | The tree control ignores the Windows High Contrast setting and renders normally, using the tree control's configured colors and themes. This is the default. | | SFTTREE_HIGHCONTRAST_ON | The tree control always renders using the Windows system color palette (COLOR_WINDOW, COLOR_WINDOWTEXT, COLOR_HIGHLIGHT, etc.) as if Windows High Contrast were active. | | SFTTREE_HIGHCONTRAST_AUTO | The tree control follows the current Windows High Contrast accessibility setting and switches automatically when the user changes it. | ### Returns GetHighContrastMode returns a value indicating the current high contrast mode setting (SFTTREE_HIGHCONTRAST_OFF, SFTTREE_HIGHCONTRAST_ON or SFTTREE_HIGHCONTRAST_AUTO). IsHighContrastActive returns TRUE if high contrast rendering is currently in effect on the tree control, otherwise FALSE. When *mode* is SFTTREE_HIGHCONTRAST_AUTO, the return value reflects the current Windows accessibility setting. ### Comments The SetHighContrastMode, GetHighContrastMode and IsHighContrastActive functions define and retrieve a tree control's high contrast mode setting. The default is SFTTREE_HIGHCONTRAST_OFF; applications opt into accessibility tracking with SFTTREE_HIGHCONTRAST_AUTO so the control follows the Windows High Contrast setting automatically. When high contrast rendering is active, caller-supplied color overrides set with [SetCtlColors](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors), per-column colors, permanent background color, selection colors, grid line colors and odd-row colors are ignored on the default render path. The control instead uses the matching Windows system color (COLOR_WINDOW for backgrounds, COLOR_WINDOWTEXT for text, COLOR_HIGHLIGHT / COLOR_HIGHLIGHTTEXT for selection, COLOR_BTNSHADOW for [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines), etc.), complying with Microsoft's High Contrast guidance that the user's chosen contrast theme must not be overridden by the application. [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) are also suppressed in high contrast mode - *fThemed* is FALSE on both [SFTTREE_OWNERDRAW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdraw) callbacks and in internal header / footer rendering, so paint falls back to the non-themed GDI path that honors system colors. When *mode* is SFTTREE_HIGHCONTRAST_AUTO, the tree control tracks WM_SETTINGCHANGE / SPI_SETHIGHCONTRAST [notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) from Windows and re-renders automatically when the user toggles the accessibility setting. A SFTTREEN_HIGHCONTRAST_CHANGED notification is sent to the parent window each time the active state flips so the application can repaint other UI to match. Owner-draw callbacks receive the current state in SFTTREE_OWNERDRAW's *fHighContrast* field. The strict color remap described above applies only to the default render path; owner-draw code is responsible for its own high contrast compliance. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## HorizontalExtent *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontalextent* Defines the horizontal extent (in pixels) of the displayable area. C ``` int WINAPI SftTree_GetHorizontalExtent(HWND hwndCtl); BOOL WINAPI SftTree_SetHorizontalExtent(HWND hwndCtl, int width); int WINAPI SftTreeSplit_GetHorizontalExtent(HWND hwndCtl, BOOL fLeft); BOOL WINAPI SftTreeSplit_SetHorizontalExtent(HWND hwndCtl, int width, BOOL fLeft); ``` C++ ``` int CSftTree::GetHorizontalExtent() const; BOOL CSftTree::SetHorizontalExtent(int width); int CSftTreeSplit::GetHorizontalExtent(BOOL fLeft = FALSE) const; BOOL CSftTreeSplit::SetHorizontalExtent(int width, BOOL fLeft = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. width The new width (in pixels) of the displayable area. If this parameter is greater than the window width, the tree control can be scrolled horizontally. fLeft Set to TRUE to return or set the horizontal extent of the left side of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) (the portion of the tree control containing the hierarchy). If FALSE is specified, the horizontal extent of the right side is returned or set. ### Returns GetHorizontalExtent returns the width of the tree control's displayable area in pixels. SetHorizontalExtent returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetHorizontalExtent and SetHorizontalExtents functions define the horizontal extent (in pixels) of the displayable area. A tree control's displayable area can be wider than the tree control's window width. If the displayable area is wider, the tree control can be scrolled horizontally if it has a horizontal scroll bar (WS_HSCROLL [window style](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles)). The width of the displayable area can be set by the application using SetHorizontalExtent or by calculating the optimal width using [RecalcHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_recalchorizontalextent). For performance reasons, the optimal width is not automatically calculated when adding items to a tree control. The width set using SetHorizontalExtent must be equal to or greater than the combined column widths, otherwise it will fail. If the width returned is smaller than the actual window width, the control cannot be scrolled horizontally. The horizontal scroll bar will be disabled or hidden, based on the window style SFTTREESTYLE_DISABLENOSCROLL. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## HorizontalOffset *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontaloffset* Defines the current horizontal offset (in pixels) of the displayed area. C ``` int WINAPI SftTree_GetHorizontalOffset(HWND hwndCtl); BOOL WINAPI SftTree_SetHorizontalOffset(HWND hwndCtl, int offset); int WINAPI SftTreeSplit_GetHorizontalOffset(HWND hwndCtl, BOOL fLeft); BOOL WINAPI SftTreeSplit_SetHorizontalOffset(HWND hwndCtl, int offset, BOOL fLeft); ``` C++ ``` int CSftTree::GetHorizontalOffset() const; int CSftTree::SetHorizontalOffset(int offset); int CSftTreeSplit::GetHorizontalOffset(BOOL fLeft = FALSE) const; int CSftTreeSplit::SetHorizontalOffset(int offset, BOOL fLeft = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. offset The new offset (in pixels) of the displayed area. If this parameter is greater than the displayable area width, the value is adjusted to scroll to the rightmost position possible. fLeft Set to TRUE to return or set the horizontal offset of the left side of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) (the portion of the tree control containing the hierarchy). If FALSE is specified, the horizontal offset of the right side is returned or set. ### Returns GetHorizontalOffset returns the current offset (in pixels) of the displayed portion of the tree control. SetHorizontalOffset returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetHorizontalOffset and SetHorizontalOffset functions define the current horizontal offset (in pixels) of the displayed area. A tree control's displayable area can be wider than the tree control's window width. If the displayable area is wider, the tree control can be scrolled horizontally if it has a horizontal scroll bar (WS_HSCROLL [window style](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles)). The current offset determines the amount of [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling). The current offset of the displayed area can be set by the application using SetHorizontalOffset. A tree control can only be scrolled horizontally if its displayable area is wider than the tree control window. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ImageScaling *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_imagescaling* Defines how images drawn by the tree control are scaled relative to the current monitor DPI. C ``` void WINAPI SftTree_SetImageScaling(HWND hwndCtl, int mode); int WINAPI SftTree_GetImageScaling(HWND hwndCtl); void WINAPI SftTreeSplit_SetImageScaling(HWND hwndCtl, int mode); int WINAPI SftTreeSplit_GetImageScaling(HWND hwndCtl); ``` C++ ``` void CSftTree::SetImageScaling(int mode); int CSftTree::GetImageScaling() const; void CSftTreeSplit::SetImageScaling(int mode); int CSftTreeSplit::GetImageScaling() const; ``` ### Parameters hwndCtl The window handle of the tree control. mode Defines the [image scaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dpi) mode. *mode* can be one of the following values: | | | | --- | --- | | SFTTREE_IMAGESCALING_ASIS | Every image is drawn at its native pixel size, regardless of the current monitor DPI. This is the default and preserves the traditional SftTree/DLL behavior. On high-DPI monitors, images supplied at 96 DPI appear physically smaller than the surrounding text. | | SFTTREE_IMAGESCALING_STRETCH | Every image is scaled by the factor *currentDPI / 96* when drawn. On a 150% DPI monitor, a 16-pixel-tall image is drawn 24 pixels tall; on a 200% monitor it is drawn 32 pixels tall. Bitmap images use StretchBlt with HALFTONE mode; [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) images use InterpolationModeHighQualityBicubic. | ### Returns GetImageScaling returns a value indicating the current image scaling mode (SFTTREE_IMAGESCALING_ASIS or SFTTREE_IMAGESCALING_STRETCH). ### Comments The SetImageScaling and GetImageScaling functions define how images drawn by the tree control are scaled relative to the current monitor DPI. The setting applies to every image the control draws: - caller-supplied [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) images used for [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), label, item, row-header, column-header and column-footer pictures, - caller-supplied [plus/minus bitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_plusminus_bitmap) ([SetPlusMinus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_plusminus)) and user-supplied tree button bitmaps ([SetButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_buttons)), - tree control owned images - automatic expand / collapse glyphs, legacy glyph sprites, check-mark images used in column-filter drop-downs, and the split-tree resize handle. SetImageScaling is independent of [SetPixelScaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pixelscaling). SetImageScaling controls the size at which images are drawn; SetPixelScaling controls how caller-supplied pixel dimensions (column widths, indentation, row-header width, etc.) are interpreted. Either can be used without the other. SFTTREE_IMAGESCALING_ASIS (the default) preserves back-compatible behavior - applications that already supply DPI-appropriate images (or that only target 96 DPI) do not need to change anything. SFTTREE_IMAGESCALING_STRETCH is the simplest way to make an existing application look correct on high-DPI monitors without shipping multiple image sizes, at the cost of some visual softness from the stretch filter. For best image quality at high DPI, supply higher-resolution master images and leave the mode at SFTTREE_IMAGESCALING_ASIS. When the control is hosted on a Per-Monitor v2 DPI-aware window, the control re-renders automatically on DPI change. Callers who have opted into SFTTREE_IMAGESCALING_STRETCH do not need to re-register images in response to [SFTTREEN_DPI_CHANGED](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dpi). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Indentation *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_indentation* Defines the indentation (in pixels) for item levels. C ``` int WINAPI SftTree_GetIndentation(HWND hwndCtl); BOOL WINAPI SftTree_SetIndentation(HWND hwndCtl, int pixels); int WINAPI SftTreeSplit_GetIndentation(HWND hwndCtl); BOOL WINAPI SftTreeSplit_SetIndentation(HWND hwndCtl, int pixels); ``` C++ ``` int CSftTree::GetIndentation() const; int CSftTree::SetIndentation(int pixels); int CSftTreeSplit::GetIndentation() const; int CSftTreeSplit::SetIndentation(int pixels); ``` ### Parameters hwndCtl The window handle of the tree control. pixels The indentation (in pixels) for item levels. Valid values are greater or equal to 0. Set to -1 to allow the tree control to determine the best indentation, based on [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) width, font size, etc. ### Returns GetIndentation returns the current indentation (in pixels) for each level. SetIndentation returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetIndentation and SetIndentation functions define the indentation (in pixels) for item levels. Each item is indented the specified number of pixels for each level. The [GetItemLevel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel) and SetItemLevel functions define an item's level number. It is possible to specify a very small value or even 0 for the level indentation. With such a small value, the hierarchy and its components, such as [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines), [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) may no longer have sufficient space and must be turned off by the application. The [SetItemPictureAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicturealign) function can be used to define the alignment of connecting tree lines, [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) and [cell pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## InheritBgColor *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_inheritbgcolor* Defines whether the area to the left of the first [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) inherits the cell's background color. C ``` BOOL WINAPI SftTree_GetInheritBgColor(HWND hwndCtl); void WINAPI SftTree_SetInheritBgColor(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetInheritBgColor(HWND hwndCtl); void WINAPI SftTreeSplit_SetInheritBgColor(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetInheritBgColor() const; void CSftTree::SetInheritBgColor(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetInheritBgColor() const; void CSftTreeSplit::SetInheritBgColor(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to inherit the background color, otherwise set to FALSE. ### Returns GetInheritBgColor returns a value indicating whether the background color is inherited. TRUE is returned if the column or cell background color is inherited, otherwise FALSE. ### Comments The GetInheritBgColor and SetInheritBgColor functions define whether the area to the left of the first cell inherits the cell's background color. If FALSE is specified, the area to the left of the first cell uses the foreground and background colors defined using [SetCtlColors](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors) ([SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors), colorFg and colorBg, colorSelFg and colorSelBg). Otherwise, the column or cell specific colors of the first displayed column are used. Column colors are defined using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) ([SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex), colorFg and colorBg, colorFgSel and colorBgSel). Cell colors are defined using [SetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo) ([SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell), colorFg and colorBg, colorFgSel and colorBgSel). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## InsertString *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring* Inserts a new item using a string. C ``` int SftTree_InsertString(HWND hwndCtl, int index, LPCTSTR lpszText); int WINAPI SftTree_InsertString_A(HWND hwndCtl, int index, LPCSTR lpszText); int WINAPI SftTree_InsertString_W(HWND hwndCtl, int index, LPCWSTR lpszText); int SftTreeSplit_InsertString(HWND hwndCtl, int index, LPCTSTR lpszText); int WINAPI SftTreeSplit_InsertString_A(HWND hwndCtl, int index, LPCSTR lpszText); int WINAPI SftTreeSplit_InsertString_W(HWND hwndCtl, int index, LPCWSTR lpszText); ``` C++ ``` int CSftTree::InsertString(int index, LPCTSTR lpszText); int CSftTreeSplit::InsertString(int index, LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the location where the item is to be inserted. If -1 is specified, the item will be added at the end of the tree control. lpszText Points to the null-terminated string that is to be used as text for the first (or only) column. This parameter may be NULL. ### Returns The return value is the zero-based index of the newly added item. The return value is -1 if an error occurred. ### Comments The InsertString function inserts a new item using a string. By default, new items are added at level 0. Use [SetItemLevel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel) to change an item's level. The tree control creates a copy of the string supplied. [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) can be used to add items at the end of the list. The maximum number of items is the maximum positive number which can be represented by the "int" type. However, virtual storage will be depleted well before this theoretical limit can be reached, not to mention the excessive load-time. The WM_SETREDRAW Windows message (CWnd::SetRedraw) can be used to suppress the tree control from being redrawn when many items are added. The use of WM_SETREDRAW is strongly recommended when adding many items to the tree control, as it avoids significant processing while items are added and drastically reduces the time needed to populate the tree control. WM_SETREDRAW (FALSE) should be used once, then all items should be added followed by one final WM_SETREDRAW (TRUE) message. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemBitmap *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itembitmap* Defines an item's [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap). C ``` HBITMAP WINAPI SftTree_GetItemBitmap(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemBitmap(HWND hwndCtl, int index, HBITMAP hBitmap); HBITMAP WINAPI SftTreeSplit_GetItemBitmap(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemBitmap(HWND hwndCtl, int index, HBITMAP hBitmap); ``` C++ ``` CBitmap* CSftTree::GetItemBitmap(int index) const; BOOL CSftTree::SetItemBitmap(int index, int val = 0); BOOL CSftTree::SetItemBitmap(int index, const CBitmap& Bitmap); CBitmap* CSftTreeSplit::GetItemBitmap(int index) const; BOOL CSftTreeSplit::SetItemBitmap(int index, int val = 0); BOOL CSftTreeSplit::SetItemBitmap(int index, const CBitmap& Bitmap); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the item picture is to be retrieved or set. hBitmap, Bitmap A bitmap handle or a reference to a CBitmap object to be used as item picture. The top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL to remove an item's item picture. val The only allowable value is 0, which is used to clear the item's item picture. ### Returns GetItemBitmap returns the handle of the bitmap used to draw the requested item's item picture, or NULL if the item doesn't have a defined item bitmap. SetItemBitmap returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemBitmap and SetItemBitmap functions define an item's item picture. Get/SetItemBitmap can be used to define an item picture using a bitmap handle only. Get/[SetItemPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicture) can be used to define an item picture using a bitmap, icon or ImageList image. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, all item pictures used for all items must be the same size. New default pictures can be registered at any time using [SetPictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures), but all item pictures in use must be replaced by pictures of the new size. In a variable height tree control, item pictures can be of varying sizes. The largest picture size must be registered using SetPictures. Item pictures defined using SetItemBitmap must be of equal or smaller size. If an item doesn't have an item picture, the space normally occupied by the item picture is left blank. An item may have an associated item picture without the item picture area actually being visible. The item picture area doesn't become visible until the item picture size has been registered using SetPictures. The CBitmap* pointer returned by GetItemBitmap may point to a temporary object and should not be stored for later use. The application retains ownership of the bitmaps and cannot delete the bitmaps until the tree control no longer uses the bitmaps (usually until the tree control is destroyed or the bitmaps are changed). **![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) **In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemBitmap can only be used to register the picture size, otherwise an error is returned. The *ItemPicture* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemBitmapAlign *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itembitmapalign* Defines whether [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) of items are aligned with the [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) of the immediate [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) level. C ``` BOOL WINAPI SftTree_GetItemBitmapAlign(HWND hwndCtl); void WINAPI SftTree_SetItemBitmapAlign(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetItemBitmapAlign(HWND hwndCtl); void WINAPI SftTreeSplit_SetItemBitmapAlign(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetItemBitmapAlign() const; void CSftTree::SetItemBitmapAlign(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetItemBitmapAlign() const; void CSftTreeSplit::SetItemBitmapAlign(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to align item pictures of items with the cells of the immediate parent item. ### Returns GetItemBitmapAlign returns a value indicating whether item pictures of items are aligned with the cells of the immediate parent level. ### Comments The GetItemBitmapAlign and SetItemBitmapAlign functions define whether item pictures of items are aligned with the cells of the immediate parent level. As items are indented based on their levels, the width of the indentation is determined by the width of the [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) bitmaps, the width of the item pictures and the [default font](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_font) used for the tree control. By using SetItemBitmapAlign(TRUE), item pictures of items at a lower level can be aligned with the cell of the immediate parent level. If the [SetIndentation](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_indentation) function is used to define the exact indentation for item levels, the [SetItemPictureAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicturealign) defines whether [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines) are aligned with the parent's item picture or simply centered within the parent's cell. In a [variable height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, item pictures may be of varying widths and heights. If item pictures are smaller than the maximum width registered using [SetPictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures), the item pictures are horizontally centered within the space available for item pictures. This results in (smaller) item pictures not aligned with the cells of the parent level. Get/SetItemPictureAlign is a synonym for Get/SetItemBitmapAlign. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemData *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata* Defines an item's application-specific value. C ``` SFTTREE_DWORD_PTR WINAPI SftTree_GetItemData(HWND hwndCtl, int index); int WINAPI SftTree_SetItemData(HWND hwndCtl, int index, SFTTREE_DWORD_PTR dwd); SFTTREE_DWORD_PTR WINAPI SftTreeSplit_GetItemData(HWND hwndCtl, int index); int WINAPI SftTreeSplit_SetItemData(HWND hwndCtl, int index, SFTTREE_DWORD_PTR dwd); ``` C++ ``` SFTTREE_DWORD_PTR CSftTree::GetItemData(int index) const; LPVOID CSftTree::GetItemDataPtr(int index) const; int CSftTree::SetItemData(int index, SFTTREE_DWORD_PTR dwd); int CSftTree::SetItemDataPtr(int index, LPVOID ptr); SFTTREE_DWORD_PTR CSftTreeSplit::GetItemData(int index) const; LPVOID CSftTreeSplit::GetItemDataPtr(int index) const; int CSftTreeSplit::SetItemData(int index, SFTTREE_DWORD_PTR dwd); int CSftTreeSplit::SetItemDataPtr(int index, LPVOID ptr); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the application-defined value is to be retrieved or set. dwd, ptr The application-defined value to be associated with the specified item. ### Returns GetItemData(Ptr) returns the application-defined value specified for the item using SetItemData(Ptr) or -1 if an error occurred. SetItemData(Ptr) returns 0 if the function was successful, otherwise -1 is returned. ### Comments The GetItemData and SetItemData functions define an item's application-specific value. The application-defined value can be used by an application to associate additional information with an item, such as a pointer to a structure with application-specific data. The deletion callback can be used for cleanup processing when items are deleted (see [SetDeleteCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletecallback)). [SetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo) can be used to define an application-specific value associated with a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell). [SetControlData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controldata) can be used to save an application-defined value associated with the tree control. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemData and SetItemDataPtr cannot be used and an error is returned. The *dwdData* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemEditIgnore *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemeditignore* Defines whether an item is ignored for [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). C ``` BOOL WINAPI SftTree_GetItemEditIgnore(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemEditIgnore(HWND hwndCtl, int index, BOOL fIgnore); BOOL WINAPI SftTreeSplit_GetItemEditIgnore(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemEditIgnore(HWND hwndCtl, int index, BOOL fIgnore); ``` C++ ``` BOOL CSftTree::GetItemEditIgnore(int index) const; BOOL CSftTree::SetItemEditIgnore(int index, BOOL fIgnore = TRUE); BOOL CSftTreeSplit::GetItemEditIgnore(int index) const; BOOL CSftTreeSplit::SetItemEditIgnore(int index, BOOL fIgnore = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the cell editing value is to be retrieved or set. fIgnore Set to TRUE to mark the item as non-editable, otherwise set to FALSE. ### Returns GetItemEditIgnore returns a value indicating whether an item is ignored for cell editing. TRUE is returned if the item is not used for cell editing, otherwise FALSE. SetItemEditIgnore returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemEditIgnore and SetItemEditIgnore functions define whether an item is ignored for cell editing. The tree control doesn't control cell editing, which is always performed by the application. The value defined using SetItemEditIgnore is not used by the tree control in any way, but can be used by the application during cell editing and navigation to determine whether certain items need to be ignored during cell editing, i.e., they cannot be edited. Individual [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) can be ignored for cell editing using the [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) structure's *flag2* member (SFTTREECELL_EDITIGNORE). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemEditIgnore cannot be used and an error is returned. The *flag2* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemExpand *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpand* Defines an item's [expand status](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_expandstatus). C ``` BOOL WINAPI SftTree_GetItemExpand(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemExpand(HWND hwndCtl, int index, BOOL fExpand, BOOL fDepth); BOOL WINAPI SftTreeSplit_GetItemExpand(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemExpand(HWND hwndCtl, int index, BOOL fExpand, BOOL fDepth); ``` C++ ``` BOOL CSftTree::GetItemExpand(int index) const; BOOL CSftTree::SetItemExpand(int index, BOOL fExpand = TRUE, BOOL fDepth = FALSE); BOOL CSftTreeSplit::GetItemExpand(int index) const; BOOL CSftTreeSplit::SetItemExpand(int index, BOOL fExpand = TRUE, BOOL fDepth = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the expand status is to be retrieved or set. fExpand Set to TRUE to expand the item or FALSE to collapse the item. fDepth Set to TRUE to expand the item's indirect [dependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) in addition to the immediate dependents. This parameter is ignored if *fExpand* is set to FALSE. ### Returns GetItemExpand returns the current expand status of the specified item, TRUE if one or more dependent items are visible (the item is expanded), FALSE if no dependents are visible or if the item doesn't have any dependents. SetItemExpand returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemExpand and SetItemExpand functions define an item's expand status. SetItemExpand does not preserve the expand/collapse state of dependent items. Use the [Collapse](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_collapse) function instead, which can optionally preserve this information. An item can be expanded/collapsed under program control using SetItemExpand. To determine if an item can be expanded, [GetDependentCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependentcount) can be used. An item must currently be shown in order to be expanded or collapsed using this function. Use [SetItemShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemshown) to make an item visible. SetItemExpand only takes effect when an item is a [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) (has child items), otherwise it is ignored and SetItemExpand will return FALSE. When items are added to a collapsed parent item (using the [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring), [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring) and the [ItemLevel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel) functions), the parent item is automatically expanded. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemExpand cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemExpandable *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandable* Defines whether an item is expandable. C ``` BOOL WINAPI SftTree_GetItemExpandable(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemExpandable(HWND hwndCtl, int index, BOOL fExpandable); BOOL WINAPI SftTreeSplit_GetItemExpandable(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemExpandable(HWND hwndCtl, int index, BOOL fExpandable); ``` C++ ``` BOOL CSftTree::GetItemExpandable(int index) const; BOOL CSftTree::SetItemExpandable(int index, BOOL fExpandable = TRUE); BOOL CSftTreeSplit::GetItemExpandable(int index) const; BOOL CSftTreeSplit::SetItemExpandable(int index, BOOL fExpandable = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the expandable status is to be retrieved or set. fExpandable Set to TRUE to make the item an expandable item or FALSE to collapse the item and delete all [dependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents). ### Returns GetItemExpandable returns TRUE if the item is expandable, FALSE if the item doesn't have any dependents. SetItemExpandable returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemExpandable and SetItemExpandable functions define whether an item is expandable. Normally, only a [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) (with dependents) is expandable. Instead of adding dependent items, an item can be made a parent item using the SetItemExpandable function. An expandable item displays an [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) and displays a suitable [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap). A [leaf item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_leaf) can be made a "temporary" parent item by using SetItemExpandable(TRUE). The item now displays an expand/collapse button and other attributes, such as the item picture, even though no dependents are present. The item can be expanded by the application in response to a SFTTREEN_-style [notification](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications). The application can then add child items as the user expands this "temporary" parent item, making it into a real parent item. When using SetItemExpandable, dependents are always removed unless the item is already expanded. When using SetItemExpandable(FALSE), the item is collapsed (and its dependents are removed). When using SetItemExpandable(TRUE) and the item is already expanded and has dependents, the item remains unchanged. An item's expand/collapse button can be hidden using the [SetItemExpandCollapseButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandcollapsebutton) function. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemExpandable cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## ItemExpandCollapseButton *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandcollapsebutton* Defines whether an item's [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) is shown. C ``` BOOL WINAPI SftTree_GetItemExpandCollapseButton(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemExpandCollapseButton(HWND hwndCtl, int index, BOOL fShown); BOOL WINAPI SftTreeSplit_GetItemExpandCollapseButton(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemExpandCollapseButton(HWND hwndCtl, int index, BOOL fShown); ``` C++ ``` BOOL CSftTree::GetItemExpandCollapseButton(int index) const; BOOL CSftTree::SetItemExpandCollapseButton(int index, BOOL fShown = TRUE); BOOL CSftTreeSplit::GetItemExpandCollapseButton(int index) const; BOOL CSftTreeSplit::SetItemExpandCollapseButton(int index, BOOL fShown = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the expand/collapse button is to be shown or hidden. fShown Set to TRUE to show the item's expand/collapse button or FALSE to hide the item's expand/collapse button. ### Returns GetItemExpandCollapseButton returns TRUE if the item's expand/collapse button is shown, FALSE if the item's expand/collapse button is hidden. ### Comments The GetItemExpandCollapseButton and SetItemExpandCollapseButton functions define whether an item's expand/collapse button is shown. SetItemExpandCollapseButton can only be used to show/hide an expand/collapse button for an item that has an expand/collapse button. [Leaf items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_leaf) do not have an expand/collapse button, so it is not possible for SetItemExpandCollapseButton to be used to show an expand/collapse button. The [SetItemExpandable](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandable) function can be used instead to mark an item as expandable, so it receives an expand/collapse button. An item marked as expandable can have its expand/collapse button suppressed using the SetItemExpandCollapseButton function. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemExpandCollapseButton cannot be used and an error is returned. The *flag2* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemHeight *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheight* Returns an item's height (in pixels). C ``` int WINAPI SftTree_GetItemHeight(HWND hwndCtl); int WINAPI SftTree_GetItemHeightVar(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetItemHeight(HWND hwndCtl); int WINAPI SftTreeSplit_GetItemHeightVar(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetItemHeight() const; int CSftTree::GetItemHeight(int index) const; int CSftTreeSplit::GetItemHeight() const; int CSftTreeSplit::GetItemHeight(int index) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of an item in a [variable height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control for which the item height is to be retrieved. This parameter can not be used in a fixed height tree control. ### Returns The return value is the current height (in pixels) of all items in a fixed height tree control or the height of a specified item in a variable height tree control. -1 is returned if an error occurred. ### Comments The GetItemHeight function returns an item's height (in pixels). In a fixed height tree control, all items in a tree control have the same height. The best height for items is automatically calculated based on the pictures and other attributes used. If multi-line text entries are desired, [SetItemLines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlines) should be used to set the expected (maximum) number of lines per item. This insures that multiple lines of text will fit within the vertical space allocated to each item. The [SetItemHeightMinMax](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheightminmax) function can be used to define an item's minimum and maximum height (in pixels). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemHeightMinMax *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheightminmax* Defines an item's minimum and maximum height (in pixels). C ``` void WINAPI SftTree_GetItemHeightMinMax(HWND hwndCtl, int index, int* pMin, int* pMax); BOOL WINAPI SftTree_SetItemHeightMinMax(HWND hwndCtl, int index, int minHeight, int maxHeight); void WINAPI SftTreeSplit_GetItemHeightMinMax(HWND hwndCtl, int index, int* pMin, int* pMax); BOOL WINAPI SftTreeSplit_SetItemHeightMinMax(HWND hwndCtl, int index, int minHeight, int maxHeight); ``` C++ ``` void CSftTree::GetItemHeightMinMax(int index, int* pMin, int* pMax) const; BOOL CSftTree::SetItemHeightMinMax(int index, int minHeight, int maxHeight); void CSftTreeSplit::GetItemHeightMinMax(int index, int* pMin, int* pMax) const; BOOL CSftTreeSplit::SetItemHeightMinMax(int index, int minHeight, int maxHeight); ``` ### Parameters hwndCtl The window handle of the tree control. index In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, *index* must be -1 and defines the minimum and maximum height for all items. In a variable height tree control, *index* defines the zero-based index of the item for which the minimum and maximum height is to be set. pMin Returns the currently defined minimum height. If no minimum height has been defined, 0 is returned. pMax Returns the currently defined maximum height. If no maximum height has been defined, 0 is returned. minHeight Defines the item's minimum height. Specify 0 to allow the control to determine the optimal height. maxHeight Defines the item's maximum height. Specify 0 to allow the control to determine the optimal height. ### Returns SetItemHeightMinMax returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemHeightMinMax and SetItemHeightMinMax functions define an item's minimum and maximum height (in pixels). Normally, SftTree/DLL determines the best item height for all items by analyzing their attributes. It may be desirable to override this height for certain items or all items. The SetItemHeightMinMax can be used to force a defined minimum and maximum height. *Minimum* and *maximum* can be set to the same value, in which case the defined item(s) will have the specified height. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a variable height tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemHeightMinMax cannot be used. The *minHeight* and *maxHeight* members of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure are used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemID *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemid* Defines an item's ID. C ``` SFTTREE_ID WINAPI SftTree_GetItemID(HWND hwndCtl, int index); void WINAPI SftTree_SetItemID(HWND hwndCtl, int index, SFTTREE_ID ID); SFTTREE_ID WINAPI SftTreeSplit_GetItemID(HWND hwndCtl, int index); void WINAPI SftTreeSplit_SetItemID(HWND hwndCtl, int index, SFTTREE_ID ID); ``` C++ ``` SFTTREE_ID CSftTree::GetItemID(int index) const; void CSftTree::SetItemID(int index, SFTTREE_ID ID); SFTTREE_ID CSftTreeSplit::GetItemID(int index) const; void CSftTreeSplit::SetItemID(int index, SFTTREE_ID ID); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of an item for which the item ID is to be retrieved or set. ID The item's item ID. ### Returns GetItemID returns the item's item ID. SetItemID returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemID and SetItemID functions define an item's ID. When an item is added to the tree control, it is automatically assigned a unique ID, which does not change throughout the lifetime of an item. Even if an item changes its index position because other items are deleted or inserted, the item ID remains constant. An application can change an item's item ID using the SetItemID function. In this case, if a unique item ID is required, the application must insure using its own mechanisms that unique IDs are used. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemID cannot be used and an error is returned. The *key* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemIgnore *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemignore* Defines whether the item is excluded from optimal column width and [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) width calculation. C ``` BOOL WINAPI SftTree_GetItemIgnore(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemIgnore(HWND hwndCtl, int index, BOOL fIgnore); BOOL WINAPI SftTreeSplit_GetItemIgnore(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemIgnore(HWND hwndCtl, int index, BOOL fIgnore); ``` C++ ``` BOOL CSftTree::GetItemIgnore(int index) const; BOOL CSftTree::SetItemIgnore(int index, BOOL fIgnore = TRUE); BOOL CSftTreeSplit::GetItemIgnore(int index) const; BOOL CSftTreeSplit::SetItemIgnore(int index, BOOL fIgnore = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item which is to be excluded from optimal column width and row header width calculation. fIgnore Set to TRUE to exclude the item *index* from optimal column width and row header width calculation, otherwise set to FALSE. ### Returns GetItemIgnore returns TRUE if the item is excluded from optimal column width and row header width calculation, otherwise FALSE is returned. SetItemIgnore returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemIgnore and SetItemIgnore functions define whether the item is excluded from optimal column width and row header width calculation. If an item is ignored, [CalcOptimalColumnWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth), [CalcOptimalRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalrowheaderwidth), [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal) and [MakeRowHeaderOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowheaderoptimal) will not consider the item when calculating the optimal column or row header width. Individual [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) can be ignored using the [SetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo) function by setting the value [SFTTREECELL_IGNORE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) in the *flag2* member of the SFTTREE_CELL structure. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemIgnore cannot be used and an error is returned. The *flag2* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemIndex *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemindex* Returns an item's index given an item ID. C ``` int WINAPI SftTree_GetItemIndex(HWND hwndCtl, SFTTREE_ID id); int WINAPI SftTreeSplit_GetItemIndex(HWND hwndCtl, SFTTREE_ID id); ``` C++ ``` int CSftTree::GetItemIndex(SFTTREE_ID id) const; int CSftTreeSplit::GetItemIndex(SFTTREE_ID id) const; ``` ### Parameters hwndCtl The window handle of the tree control. id The item ID of an item for which the zero-based index is to be retrieved. ### Returns GetItemIndex returns an item's index given an item ID. ### Comments The GetItemIndex function returns an item's index given an item ID. The item ID returned by [GetItemID](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemid) does not change throughout the lifetime of an item. Even if an item changes its index position because other items are deleted or inserted, the item ID remains constant. The item index describes the zero-based position of an item in a tree control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemLabel *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabel* Defines an item's [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap) information. C ``` HBITMAP WINAPI SftTree_GetItemLabel(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemLabel(HWND hwndCtl, int index, HBITMAP hBitmap); HBITMAP WINAPI SftTreeSplit_GetItemLabel(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemLabel(HWND hwndCtl, int index, HBITMAP hBitmap); ``` C++ ``` CBitmap* CSftTree::GetItemLabel(int index) const; BOOL CSftTree::SetItemLabel(int index, int val = 0); BOOL CSftTree::SetItemLabel(int index, const CBitmap& Bitmap); CBitmap* CSftTreeSplit::GetItemLabel(int index) const; BOOL CSftTreeSplit::SetItemLabel(int index, int val = 0); BOOL CSftTreeSplit::SetItemLabel(int index, const CBitmap& Bitmap); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the label picture is to be retrieved or set. This parameter may be -1 to register the label picture size and make the label picture area visible using SetItemLabel. hBitmap, Bitmap A bitmap handle or a reference to a CBitmap object to use as the label picture for the specified item. The top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. If the index parameter is -1, this bitmap is only used to determine the bitmap size of all label pictures. This parameter may be NULL to remove an item's label picture or to stop displaying label pictures for all items (set index to -1). val The only allowable value is 0, which is used to remove the item's label picture. ### Returns GetItemLabel returns the bitmap used to draw the requested item's label picture, or NULL if the item doesn't have a defined label bitmap. SetItemLabel returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemLabel and SetItemLabel functions define an item's label picture information. Get/SetItemLabel can be used to define a label picture using a bitmap handle only. Get/[SetItemLabelPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabelpicture) can be used to define a label picture using a bitmap, icon or ImageList image. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, all label pictures used for all items must be the same size. New pictures can be registered at any time, but all label pictures in use must be replaced by pictures of the new size. In a variable height tree control, label pictures can be of varying sizes. The largest picture size must be registered using SetItemLabel. If an item doesn't have a label picture, the space normally occupied by the label picture is left blank. An item may have an associated label picture without the label picture area actually being visible. The label picture area doesn't become visible until the (largest) label picture size has been registered using SetItemLabel by setting index to -1. The CBitmap* pointer returned by GetItemLabel may be temporary and should not be stored for later use. The application retains ownership of the bitmaps and cannot delete the bitmaps until the tree control no longer uses the bitmaps (usually until the tree control is destroyed or the bitmaps are changed). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemLabel can only be used to register the label picture size, otherwise an error is returned. The *LabelPicture* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemLabelPicture *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabelpicture* Defines an item's [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap) information. C ``` BOOL WINAPI SftTree_GetItemLabelPicture(HWND hwndCtl, int index, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTree_SetItemLabelPicture(HWND hwndCtl, int index, LPCSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_GetItemLabelPicture(HWND hwndCtl, int index, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_SetItemLabelPicture(HWND hwndCtl, int index, LPCSFT_PICTURE lpPicture); ``` C++ ``` BOOL CSftTree::GetItemLabelPicture(int index, LPSFT_PICTURE lpPicture) const; BOOL CSftTree::SetItemLabelPicture(int index, LPCSFT_PICTURE lpPicture); BOOL CSftTreeSplit::GetItemLabelPicture(int index, LPSFT_PICTURE lpPicture) const; BOOL CSftTreeSplit::SetItemLabelPicture(int index, LPCSFT_PICTURE lpPicture); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the label picture is to be retrieved or set. This parameter may be -1 to register the label picture size and make the label picture area visible. lpPicture A pointer to a [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) structure to use as the label picture for the specified item. If the SFT_PICTURE structure defines a bitmap handle, the top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. If the index parameter is -1, this bitmap is only used to determine the size of all label pictures. This parameter may be NULL to remove an item's label picture or to stop displaying label pictures for all items (set index to -1). ### Returns Get/SetItemLabelPicture returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemLabelPicture and SetItemLabelPicture functions define an item's label picture information. Get/SetItemLabelPicture can be used to define a label picture using a bitmap, icon or ImageList image. Get/[SetItemLabel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabel) can be used to define a label picture using a bitmap handle only. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, all label pictures used for all items must be the same size. New pictures can be registered at any time, but all label pictures in use must be replaced by pictures of the new size. In a variable height tree control, label pictures can be of varying sizes. The largest picture size must be registered using SetItemLabelPicture. If an item doesn't have a label picture, the space normally occupied by the label picture is left blank. An item may have an associated label picture without the label picture area actually being visible. The label picture area doesn't become visible until the (largest) label picture size has been registered using SetItemLabelPicture by setting index to -1. The application retains ownership of any resources used to define the picture and cannot free these resources until the tree control no longer uses these (usually until the tree control is destroyed or the pictures are changed). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemLabelPicture can only be used to register the label picture size, otherwise an error is returned. The *LabelPicture* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemLevel *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel* Defines an item's level number. C ``` int WINAPI SftTree_GetItemLevel(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemLevel(HWND hwndCtl, int index, int level); int WINAPI SftTreeSplit_GetItemLevel(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemLevel(HWND hwndCtl, int index, int level); ``` C++ ``` int CSftTree::GetItemLevel(int index) const; BOOL CSftTree::SetItemLevel(int index, int level); int CSftTreeSplit::GetItemLevel(int index) const; BOOL CSftTreeSplit::SetItemLevel(int index, int level); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the level number is to be retrieved or set. level The new, zero-based level number of the item. ### Returns GetItemLevel returns the level number of the requested item or -1 if an error occurred. SetItemLevel returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemLevel and SetItemLevel functions define an item's level number. If an item is not visible when its level is set, it is automatically made visible by expanding its [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent)(s). If an item is collapsed when its level is set, it is first automatically expanded. The root (or highest) level is level 0, [dependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) are on levels 1, 2, 3 and lower. The lowest level is defined as level [SFTTREE_MAXLEVELS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_maxlevels) (64). The [SetIndentation](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_indentation) function can be used to define the exact indentation for item levels. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemLevel cannot be used and an error is returned. The *level* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemLines *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlines* Defines the number of text lines used for item height calculation. C ``` int WINAPI SftTree_GetItemLines(HWND hwndCtl); BOOL WINAPI SftTree_SetItemLines(HWND hwndCtl, int nLines); int WINAPI SftTreeSplit_GetItemLines(HWND hwndCtl); BOOL WINAPI SftTreeSplit_SetItemLines(HWND hwndCtl, int nLines); ``` C++ ``` int CSftTree::GetItemLines() const; BOOL CSftTree::SetItemLines(int nLines); int CSftTreeSplit::GetItemLines() const; BOOL CSftTreeSplit::SetItemLines(int nLines); ``` ### Parameters hwndCtl The window handle of the tree control. nLines The number of text lines used to calculate the expected height of items. ### Returns GetItemLines returns the current number of text lines last defined using SetItemLines. SetItemLines returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemLines and SetItemLines functions define the number of text lines used for item height calculation. The height of items is determined based on an item's attributes such as registered [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) size, [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap) size, fonts used, etc. Using SetItemLines, an application can specify how many lines of [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) an item can display in a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell). In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control (see [SFTTREESTYLE_VARIABLE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles)) all cell text has the same number of text lines. If an application needs [multiple text lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_multiline_cell_text) to support word wrapping (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex), SFTTREE_WRAP) or new line characters in cell text, SetItemLines must be used to specify the number of text lines. In a variable height tree control, each item's height is determined individually. If an application allows word wrapping (see SFTTREE_COLUMN_EX, SFTTREE_WRAP) or new line characters in cell text, SetItemLines must be used to specify the maximum number of text lines to display in all cells. If cell text exceeds the specified number of lines, "+" is shown at the bottom, right corner of the cell. A tree control defaults to one line of text for each item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemPicture *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicture* Defines an item's [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap). C ``` BOOL WINAPI SftTree_GetItemPicture(HWND hwndCtl, int index, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTree_SetItemPicture(HWND hwndCtl, int index, LPCSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_GetItemPicture(HWND hwndCtl, int index, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_SetItemPicture(HWND hwndCtl, int index, LPCSFT_PICTURE lpPicture); ``` C++ ``` BOOL CSftTree::GetItemPicture(int index, LPSFT_PICTURE lpPicture) const; BOOL CSftTree::SetItemPicture(int index, LPCSFT_PICTURE lpPicture); BOOL CSftTreeSplit::GetItemPicture(int index, LPSFT_PICTURE lpPicture) const; BOOL CSftTreeSplit::SetItemPicture(int index, LPCSFT_PICTURE lpPicture); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the item picture is to be retrieved or set. lpPicture A pointer to a [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) structure to use as the item picture for the specified item. If the SFT_PICTURE structure defines a bitmap handle, the top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL to remove an item's item picture. ### Returns Get/SetItemPicture returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemPicture and SetItemPicture functions define an item's item picture. Get/SetItemPicture can be used to define an item picture using a bitmap, icon or ImageList image. Get/[SetItemBitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itembitmap) can be used to define an item picture using a bitmap handle only. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, all item pictures used for all items must be the same size. New default pictures can be registered at any time using [SetPictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures), but all item pictures in use must be replaced by pictures of the new size. In a variable height tree control, item pictures can be of varying sizes. The largest picture size must be registered using SetPictures. Item pictures defined using SetItemBitmap must be of equal or smaller size. If an item doesn't have an item picture, the space normally occupied by the item picture is left blank. An item may have an associated item picture without the item picture area actually being visible. The item picture area doesn't become visible until the item picture size has been registered using SetPictures. The application retains ownership of any resources used to define the picture and cannot free these resources until the tree control no longer uses these (usually until the tree control is destroyed or the pictures are changed). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemPicture can only be used to register the picture size, otherwise an error is returned. The *ItemPicture* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemPictureAlign *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicturealign* Defines whether [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) of items are aligned with the [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) of the immediate [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) level. C ``` BOOL WINAPI SftTree_GetItemPictureAlign(HWND hwndCtl); void WINAPI SftTree_SetItemPictureAlign(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetItemPictureAlign(HWND hwndCtl); void WINAPI SftTreeSplit_SetItemPictureAlign(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetItemPictureAlign() const; void CSftTree::SetItemPictureAlign(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetItemPictureAlign() const; void CSftTreeSplit::SetItemPictureAlign(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to align item pictures of items with the cells of the immediate parent item. ### Returns GetItemPictureAlign returns a value indicating whether item pictures of items are aligned with the cells of the immediate parent level. ### Comments The GetItemPictureAlign and SetItemPictureAlign functions define whether item pictures of items are aligned with the cells of the immediate parent level. As items are indented based on their levels, the width of the indentation is determined by the width of the [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) bitmaps, the width of the item pictures and the [default font](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_font) used for the tree control. By using SetItemPictureAlign(TRUE), item pictures of items at a lower level can be aligned with the cell of the immediate parent level. If the [SetIndentation](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_indentation) function is used to define the exact indentation for item levels, the SetItemPictureAlign function defines whether [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines) are connected to the parent's item picture or simply centered within the parent's cell. In a [variable height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, item pictures may be of varying widths and heights. If item pictures are smaller than the maximum width registered using [SetPictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures), the item pictures are horizontally centered within the space available for item pictures. This results in (smaller) item pictures not aligned with the cells of the parent level. Get/[SetItemBitmapAlign](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itembitmapalign) is a synonym for Get/SetItemPictureAlign. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemrect* Returns an item's location in client area coordinates. C ``` int WINAPI SftTree_GetItemRect(HWND hwndCtl, int index, LPRECT lpRect); int WINAPI SftTreeSplit_GetItemRect(HWND hwndCtl, int index, LPRECT lpRect); ``` C++ ``` int CSftTree::GetItemRect(int index, LPRECT lpRect) const; int CSftTreeSplit::GetItemRect(int index, LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the position is to be retrieved. lpRect Address of a RECT structure, where the coordinates will be returned. ### Returns GetItemRect returns 0 if the specified item is currently displayed and the RECT structure contains the client area coordinates of the item. -1 is returned if the item is not displayed or if an error occurred. ### Comments The GetItemRect function returns an item's location in client area coordinates. To retrieve the coordinates of a specific [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), see [GetDisplayCellRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_displaycellrect). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemShown *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemshown* Defines an item's [visibility status](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_visibilitystatus). C ``` BOOL WINAPI SftTree_GetItemShown(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemShown(HWND hwndCtl, int index, BOOL fShown); BOOL WINAPI SftTreeSplit_GetItemShown(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemShown(HWND hwndCtl, int index, BOOL fShown); ``` C++ ``` BOOL CSftTree::GetItemShown(int index) const; BOOL CSftTree::SetItemShown(int index, BOOL fShown = TRUE); BOOL CSftTreeSplit::GetItemShown(int index) const; BOOL CSftTreeSplit::SetItemShown(int index, BOOL fShown = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the visibility status is to be retrieved or set. fShown Set to TRUE to make the item visible. An item is made visible by expanding all its [parent items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent). Set to FALSE to hide the item. An item is hidden by collapsing its immediate parent item. ### Returns GetItemShown returns a value indicating the current visibility status of the specified item, TRUE if the item is visible (the parent item is expanded), FALSE if the item is not visible (the parent item is collapsed). SetItemShown returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemShown and SetItemShown functions define an item's visibility status. An item's visibility status can be retrieved using GetItemShown. Even if an item is considered "visible", it may not actually be shown, because it doesn't fall inside the area of items currently shown in the tree control's client area. Use [MakeRowVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowvisible) to make the item visible to the user. Items without parent items cannot be hidden. They always remain visible. [GetNextShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nextshown) and [GetPrevShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_prevshown) can be used to retrieve the next or previous visible item. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemShown cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemsShown *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemsshown* Returns the number of items displayable in the tree control's client area, including partial items. C ``` int WINAPI SftTree_GetItemsShown(HWND hwndCtl); int WINAPI SftTreeSplit_GetItemsShown(HWND hwndCtl); ``` C++ ``` int CSftTree::GetItemsShown() const; int CSftTreeSplit::GetItemsShown() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the number of completely and partially visible items in the tree control's client area. ### Comments The GetItemsShown function returns the number of items displayable in the tree control's client area, including partial items. [GetItemsShownComplete](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemsshowncomplete) can be used to retrieve the number of completely visible items in the tree control's client area. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemsShownComplete *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemsshowncomplete* Returns the number of items displayable in the tree control's client area, not including partial items. C ``` int WINAPI SftTree_GetItemsShownComplete(HWND hwndCtl); int WINAPI SftTreeSplit_GetItemsShownComplete(HWND hwndCtl); ``` C++ ``` int CSftTree::GetItemsShownComplete() const; int CSftTreeSplit::GetItemsShownComplete() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the number of completely visible items in the tree control's client area. ### Comments The GetItemsShownComplete function returns the number of items displayable in the tree control's client area, not including partial items. [GetItemsShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemsshown) can be used to retrieve the number of completely and partially visible items in the tree control's client area. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ItemStatus *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemstatus* Defines an item's enabled/disabled status. C ``` BOOL WINAPI SftTree_GetItemStatus(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemStatus(HWND hwndCtl, int index, BOOL fEnable); BOOL WINAPI SftTreeSplit_GetItemStatus(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemStatus(HWND hwndCtl, int index, BOOL fEnable); ``` C++ ``` BOOL CSftTree::GetItemStatus(int index) const; BOOL CSftTree::SetItemStatus(int index, BOOL fEnable = TRUE); BOOL CSftTreeSplit::GetItemStatus(int index) const; BOOL CSftTreeSplit::SetItemStatus(int index, BOOL fEnable = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the enabled/disabled status is to be retrieved or set. fEnable Set to TRUE to enable the item, set to FALSE to disable the item. ### Returns GetItemStatus returns a value indicating the current enabled/disabled status of the specified item. TRUE if the item is enabled, FALSE if the item is disabled or -1 is returned if an error occurred. SetItemStatus returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetItemStatus and SetItemStatus functions define an item's enabled/disabled status. If an item is disabled, it is drawn in a "grayed" manner indicating its status. Except for the visual difference, a disabled item is treated exactly like an enabled item. It is up to the application to implement a different behavior if an item is disabled. It is possible to prevent a user from selecting disabled items using [SFTTREE_CONTROL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control), fSelectEnabledItemsOnly. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetItemStatus cannot be used and an error is returned. The *fEnabled* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## KeyHandling *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_keyhandling* Defines keystrokes intercepted during [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). C ``` void WINAPI SftTree_GetKeyHandling(HWND hwndCtl, BYTE* lpVirtKeyIntercept, TCHAR* virtKey, BYTE* virtMask); void WINAPI SftTree_SetKeyHandling(HWND hwndCtl, const BYTE* lpVirtKeyIntercept); void WINAPI SftTreeSplit_GetKeyHandling(HWND hwndCtl, BYTE* lpVirtKeyIntercept, TCHAR* virtKey, BYTE* virtMask); void WINAPI SftTreeSplit_SetKeyHandling(HWND hwndCtl, const BYTE* lpVirtKeyIntercept); ``` C++ ``` void CSftTree::GetKeyHandling(BYTE* lpVirtKeyIntercept, TCHAR* virtKey, BYTE* virtMask) const; void CSftTree::SetKeyHandling(const BYTE* lpVirtKeyIntercept); void CSftTreeSplit::GetKeyHandling(BYTE* lpVirtKeyIntercept, TCHAR* virtKey, BYTE* virtMask) const; void CSftTreeSplit::SetKeyHandling(const BYTE* lpVirtKeyIntercept); ``` ### Parameters hwndCtl The window handle of the tree control. lpVirtKeyIntercept The address of a 256 byte storage area (the keystroke table). GetKeyHandling updates the area at the specified address with a copy of the currently defined keystroke table. This parameter may be NULL. SetKeyHandling uses the area at the specified address and copies it to its keystroke table, making the new table the currently defined keystroke table. This parameter may be NULL, in which case the currently defined keystroke table is cleared. virtKey Returns the last intercepted keystroke. GetKeyHandling returns a valid *virtKey* value only while a [SFTTREEN_KEYINTERCEPTED](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification is being processed. This parameter may be NULL. virtMask Returns the last intercepted keystroke attribute. GetKeyHandling returns a valid *virtMask* value only while a SFTTREEN_KEYINTERCEPTED notification is being processed. This parameter may be NULL. | | | | --- | --- | | SFTTREE_HANDLEPURE | The keystroke was intercepted and was used without the Control and without the Shift key. | | SFTTREE_HANDLECTRL | The keystroke was intercepted and occurred in combination with the Control key. This value can occur in combination with the SFTTREE_HANDLESHIFT value. | | SFTTREE_HANDLESHIFT | The keystroke was intercepted and occurred in combination with the Shift key. This value can occur in combination with the SFTTREE_HANDLECTRL value. | ### Comments The GetKeyHandling and SetKeyHandling functions define keystrokes intercepted during cell editing. To simplify handling of special keystrokes such as Escape, Return, arrow keys, which are normally handled by a child window during cell editing, these can be intercepted by the application using SetKeyHandling. Once a key stroke for a child window is intercepted during cell editing, the SFTTREEN_KEYINTERCEPTED notification occurs. The intercepted key can be retrieved using the GetKeyHandling function. Using SetKeyHandling eliminates the need to subclass the child window, simplifying the implementation of cell editing. To define intercepted keystrokes, the GetKeyHandling function is used to retrieve the current keystroke table. The keystroke table can then be modified, setting the desired attributes. Finally, the keystroke table is updated by a call to the SetKeyHandling function. The keystroke table is a 256 byte storage area, one byte for each virtual key code (such as VK_ESCAPE, VK_RETURN, VK_UP, etc.). Each byte contains one or a combination of the following values defining how the virtual key is processed. The virtual key code is used as index into the keystroke table. | | | | --- | --- | | SFTTREE_HANDLENONE | The keystroke is not intercepted. | | SFTTREE_HANDLEPURE | The keystroke is intercepted if it is used without the Control and without the Shift key. | | SFTTREE_HANDLECTRL | The keystroke is intercepted if it is used with the Control key. | | SFTTREE_HANDLESHIFT | The keystroke is intercepted if it is used with the Shift key. | Any keystroke that is intercepted during cell editing generates a SFTTREEN_KEYINTERCEPTED notification, to be handled by the application. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## LastDisplayColumn *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_lastdisplaycolumn* Returns the index of the last displayed column. C ``` int WINAPI SftTree_GetLastDisplayColumn(HWND hwndCtl); int WINAPI SftTreeSplit_GetLastDisplayColumn(HWND hwndCtl, BOOL fLeft); ``` C++ ``` int CSftTree::GetLastDisplayColumn() const; int CSftTreeSplit::GetLastDisplayColumn(BOOL fLeft = TRUE) const; ``` ### Parameters hwndCtl The window handle of the tree control. fLeft Set to TRUE to retrieve the column number of the last displayed column on the left side of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) (the portion of the tree control containing the hierarchy). If FALSE is specified, the column number of the last displayed column on the right side is returned. ### Returns GetLastDisplayColumn returns the zero-based [display column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) of the last displayed column. ### Comments The GetLastDisplayColumn function returns the index of the last displayed column. The last column with a width greater than 0 (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex)) is considered the last displayed column. It is not necessarily displayed or visible if [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling) is in effect. A column can be made visible using [MakeCellVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecellvisible) or [MakeColumnVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnvisible). The first displayed column can be determined using [GetFirstDisplayColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_firstdisplaycolumn). While most other functions use real column numbers, GetLastDisplayColumn returns the display column number of the last displayed column. The display column number can be translated to a real column number using [GetRealColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_realcolumn). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## LeftWindow *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_leftwindow* Returns the window handle or object of the tree control in the left pane of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). C ``` HWND WINAPI SftTreeSplit_GetLeftWindow(HWND hwndCtl); ``` C++ ``` CSftTree* CSftTreeSplit::GetLeftWindow() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the window handle or object of the tree control in the left pane of a split tree control. ### Comments The GetLeftWindow function returns the window handle or object of the tree control in the left pane of a split tree control. GetLeftWindow is only available for a split tree control. The left and right panes of a split tree control are independent tree controls, which communicate with each other to keep their display styles and data contents synchronized. These tree controls are child windows of the split tree control. While the left and right panes exchange information to keep their display and attributes updated, it is possible to affect each pane individually through the window handle or object. Each pane of a split tree control uses a tree control (of the window class [SFTTREE_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_class) or C++ class [CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api)) to display the requested [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) (see [SetSplitColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitcolumn)). Occasionally it may be necessary to manipulate the tree control in a pane directly, rather than the main split tree control (of the window class [SFTTREESPLIT_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttreesplit_class) or class CSftTreeSplit). For example, setting the split tree control's font (using the WM_SETFONT message or CWnd::SetFont) will affect both panes of the split tree control. An application could set different fonts for the two panes by using GetLeftWindow and [GetRightWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rightwindow) and setting the fonts for each pane. Or, an application could turn on [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines) for the right pane and turn them off for the left pane. [SetShowGrid](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showgrid) will affect both panes if used for the split tree control, but using GetLeftWindow and GetRightWindow, the individual panes can be defined with different attributes. Certain operations on individual panes are possible, but should never be performed. For example, accessing a pane to add or delete items is possible, but will result in unexpected behavior of the split tree control. Or turning off [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) in one pane, but not the other causes misalignment of the items displayed in each pane. In general, directly accessing a pane should rarely be necessary. See Also C/C++ API | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## LoadGDIPlusImageFromFile *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_loadgdiplusimagefromfile* Loads a [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) image from a file. C ``` LPVOID SftTree_LoadGDIPlusImageFromFile(LPCTSTR lpszFilename); ``` ### Parameters lpszFilename The path and name of the image file to load. ### Returns If successful, the return value is a Gdiplus::Image pointer or NULL if the function failed. ### Comments Loads a GDI+ image from a file. This function is mainly intended for applications written [using C](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_usingc). Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use Bitmap::FromFile to load a GDI+ image. Using SftTree_LoadGDIPlusImageFromFile even C applications can use GDI+ images, without needing access to GDI+ itself. The application retains ownership of the Gdiplus::Image pointer returned by SftTree_LoadGDIPlusImageFromFile. Once the image is no longer needed, it can be released using [SftTree_FreeGDIPlusImageLoadedFromFile](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_freegdiplusimageloadedfromfile), which frees the associated memory. LoadGDIPlusImageFromFile provides essentially the same service as the GDI+ Bitmap::FromFile function. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## LoadGDIPlusImageFromResource *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_loadgdiplusimagefromresource* Loads a [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) image from an application's or DLL's resources. C ``` LPVOID SftTree_LoadGDIPlusImageFromResource(HMODULE hInst, LPCTSTR lpszResourceType, LPCTSTR lpszResourceName); ``` ### Parameters hInst The instance handle of the application or DLL containing the resource. lpszResourceType The resource type. Can be a string or an identifier using the MAKEINTRESOURCE macro. lpszResourceName The resource name. Can be a string or an identifier using the MAKEINTRESOURCE macro. ### Returns If successful, the return value is a Gdiplus::Image pointer or NULL if the function failed. ### Comments Loads a GDI+ image from an application's or DLL's resources. This function is mainly intended for applications written [using C](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_usingc). Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use Bitmap::FromResource to load a GDI+ image. Using SftTree_LoadGDIPlusImageFromResource even C applications can use GDI+ images, without needing access to GDI+ itself. The application retains ownership of the Gdiplus::Image pointer returned by SftTree_LoadGDIPlusImageFromResource. Once the image is no longer needed, it can be released using [SftTree_FreeGDIPlusImageLoadedFromResource](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_freegdiplusimageloadedfromresource), which frees the associated memory. LoadGDIPlusImageFromResource provides essentially the same service as the GDI+ Bitmap::FromResource function. Please note that GDI+ images cannot be defined as BITMAP resources. They must be included as custom resources. The [TreeImages sample](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_samples) demonstrates how this is accomplished. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## LPFNSFTTREE_OWNERDRAWPROC Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_ownerdrawproc* Defines the type of an application-supplied owner-draw function, which is called whenever an object needs to be rendered. ``` typedef BOOL (CALLBACK* LPFNSFTTREE_OWNERDRAWPROC)( HWND hwnd, LPSFTTREE_OWNERDRAW lpInfo, SFTTREE_DWORD_PTR UserData); ``` ### Parameters hwnd The window handle of the tree control. lpInfo A pointer to the [SFTTREE_OWNERDRAW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdraw) structure describing the action required and the object to render. UserData An application-specific value, as supplied in the [SFTTREE_OWNERDRAWPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdrawparm) structure. ### Returns The return value is TRUE if the owner-draw callback was successful, FALSE otherwise. ### Comments LPFNSFTTREE_OWNERDRAWPROC defines the type of an application-supplied owner-draw function, which is called whenever an object needs to be rendered. An owner-draw function cannot modify the tree control attributes in any way. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## LPFNSFTTREE_VGETITEM Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_vgetitem* Defines the type of the [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) callback used by SftTree/DLL to retrieve information about one item as it is needed by the tree control. ``` typedef void (CALLBACK* LPFNSFTTREE_VGETITEM)( HWND hwnd, SFTTREE_DWORD_PTR userData, int totCols, LONG index, LPSFTTREE_ITEM * lplpItem); ``` ### Parameters hwnd The window handle of the tree control. userData An application-specific value, as supplied in the call to [VirtualInitialize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualinitialize) using the [SFTTREE_VIRTUALDEF](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_virtualdef) structure. totCols The total number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) defined for the tree control. index The zero-based index of the item whose attributes are to be retrieved. lplpItem A pointer to a pointer to a [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure. The callback must set this parameter to point to a properly filled SFTTREE_ITEM structure provided by the callback. ### Comments LPFNSFTTREE_VGETITEM defines the type of the virtual data source callback used by SftTree/DLL to retrieve information about one item as it is needed by the tree control. The callback must return a properly filled SFTTREE_ITEM structure. This callback is only used if a virtual data source has been defined using VirtualInitialize. If items are added using [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) or [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring), the callback is not used. The SFTTREE_ITEM structure can return pointers to additional information. Any memory addressed by pointers returned in the structure must be in static memory or allocated dynamically. All memory is managed by the called application and no memory is allocated or freed by SftTree/DLL. SftTree/DLL will always call SFTTREE_VRELEASEITEM before calling SFTTREE_VGETITEM for a new item, so an application can free any storage that was dynamically allocated by the callback. This callback cannot modify the contents of the tree control in any way. Updating the total number of items is not possible while the callback is called. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## LPFNSFTTREE_VRELEASEITEM Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_vreleaseitem* Defines the type of the [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) callback called by SftTree/DLL to release information previously returned by the SFTTREE_VGETITEM callback. ``` typedef void (CALLBACK* LPFNSFTTREE_VRELEASEITEM)( HWND hwnd, SFTTREE_DWORD_PTR userData, int totCols, LONG index, LPSFTTREE_ITEM lpItem); ``` ### Parameters hwnd The window handle of the tree control. userData An application-specific value, as supplied in the call to [VirtualInitialize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualinitialize) using the [SFTTREE_VIRTUALDEF](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_virtualdef) structure. totCols The total number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) defined for the tree control. index The zero-based index of the item to be released. lpItem A pointer to the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure returned by the previous call to the SFTTREE_VGETITEM callback. ### Comments This callback is only used if a virtual data source has been defined using VirtualInitialize. If items are added using [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) or [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring), the callback is not used. SftTree/DLL will always call SFTTREE_VRELEASEITEM before calling SFTTREE_VGETITEM for a new item, so an application can free any storage that was dynamically allocated by the callback. SFTTREE_VRELEASEITEM can be used to free any dynamically allocated memory. The SFTTREE_ITEM structure was returned by SFTTREE_VGETITEM and can contain pointers to additional information. Any memory addressed by pointers returned in the structure must be in static memory or allocated dynamically. All memory is managed by the called application and no memory is allocated or freed by SftTree/DLL. This callback cannot modify the contents of the tree control in any way. Updating the total number of items is not possible while the callback is called. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MakeCellVisible *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecellvisible* Scrolls the specified [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) into view horizontally and vertically so that it is displayed in the tree control's client area. C ``` void WINAPI SftTree_MakeCellVisible(HWND hwndCtl, int index, int realCol); void WINAPI SftTreeSplit_MakeCellVisible(HWND hwndCtl, int index, int realCol); ``` C++ ``` void CSftTree::MakeCellVisible(int index, int realCol); void CSftTreeSplit::MakeCellVisible(int index, int realCol); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the cell to scroll into view. realCol The zero-based column number of the cell to make visible. ### Comments The MakeCellVisible function scrolls the specified cell into view horizontally and vertically so that it is displayed in the tree control's client area. MakeCellVisible can be used to make a cell visible by scrolling it into view (horizontally and vertically). The user normally scrolls the tree control items horizontally and vertically using the scroll bars, but an application can use MakeCellVisible to insure that a cell is visible. To make a column or item visible, use [MakeColumnVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnvisible) or [MakeRowVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowvisible). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MakeColumnOptimal *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal* Sets the optimal column width so that the text and pictures of all items can be displayed without being clipped horizontally. C ``` void WINAPI SftTree_MakeColumnOptimal(HWND hwndCtl, int realCol); void WINAPI SftTreeSplit_MakeColumnOptimal(HWND hwndCtl, int realCol); ``` C++ ``` void CSftTree::MakeColumnOptimal(int realCol = -1, int limit = 0, BOOL fVisibleOnly = FALSE); void CSftTreeSplit::MakeColumnOptimal(int realCol = -1, int limit = 0, BOOL fVisibleOnly = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number to resize so text and pictures are completely shown. Specify -1 to resize all [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) optimally. limit Defines the maximum number of items to be considered for width calculation. Specify a number less than or equal to 0 to consider all items. If a tree control contains many items, scanning all items may be extremely slow, as each [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell)'s width needs to be calculated. Using an application defined maximum number, the calculation can be limited to *limit* items. This results in better response time, yet some items which are not within the number of scanned items may still be clipped. fVisibleOnly Specify TRUE to limit the width calculation to visible items only. Items which are not visible because their [parent items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are collapsed are not included in the width calculation. ### Comments The MakeColumnOptimal function sets the optimal column width so that the text and pictures of all items can be displayed without being clipped horizontally. MakeColumnOptimal resizes a specified column or all columns to the optimal width so that the [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) and each cell can be completely displayed without being truncated or clipped. [CalcOptimalColumnWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth) can be used to calculate a column's optimal width without resizing the column. The column width can be changed using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns). The SftTree_MakeColumnOptimal function does not support the parameters * limit* and * fVisibleOnly*. Use the [SetCalcLimit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calclimit) and [SetCalcVisibleOnly](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcvisibleonly) functions to supply this information before calling SftTree_MakeColumnOptimal. By changing tree control attributes, the optimal column width may change. Adding items, setting new [cell pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap) and changing [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) are a few of the actions that can affect the optimal column width. The column width may have to be set again to allow items to be completely visible. The tree control does not automatically adjust column widths. The last (or only) column may be an "[open-ended](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_openended)" column (see SetOpenEnded). An open-ended column will always use the space remaining between the previous column and the right edge of the tree control window. MakeColumnOptimal should be used even with an open-ended column, so the column width is optimal in case the user reorders the columns. Items can be excluded from optimal column width calculation by using the [SetItemIgnore](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemignore) function or for [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode), setting the [SFTTREEITEM_IGNORE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) value in the *flag2* member of the SFTTREE_ITEM structure. Individual cells can be excluded from optimal column width calculation by setting the [SFTTREECELL_IGNORE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) value in the *flag2* member of the SFTTREE_CELL structure. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MakeColumnVisible *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnvisible* Scrolls the specified column into view horizontally so that it is displayed in the tree control's client area. C ``` void WINAPI SftTree_MakeColumnVisible(HWND hwndCtl, int realCol); void WINAPI SftTreeSplit_MakeColumnVisible(HWND hwndCtl, int realCol); ``` C++ ``` void CSftTree::MakeColumnVisible(int realCol); void CSftTreeSplit::MakeColumnVisible(int realCol); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The zero-based column number to make visible. ### Comments The MakeColumnVisible function scrolls the specified column into view horizontally so that it is displayed in the tree control's client area. MakeColumnVisible can be used to make a column visible by scrolling it into view (horizontally). The user normally scrolls the tree control items horizontally using the scroll bar, but an application can use MakeColumnVisible to insure that a column is visible. To make a [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) or item visible, use [MakeCellVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecellvisible) or [MakeRowVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowvisible). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MakeContentWindow *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecontentwindow* Defines the specified window as a [content window](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_contentwindows) ([virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode) only). C ``` void WINAPI SftTree_MakeContentWindow(HWND hwndCtl, HWND hwndCell, BOOL fSet); void WINAPI SftTreeSplit_MakeContentWindow(HWND hwndCtl, HWND hwndCell, BOOL fLeft, BOOL fSet); ``` C++ ``` void CSftTree::MakeContentWindow(HWND hwndCell, BOOL fSet); void CSftTreeSplit::MakeContentWindow(HWND hwndCell, BOOL fLeft, BOOL fSet); ``` ### Parameters hwndCtl The window handle of the tree control. hwndCell The window handle of the content window. fLeft Set to TRUE if the content window is located in the left pane of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar), FALSE otherwise and the content window is located in the right pane. fSet Set to TRUE if the window handle described by hwndCell is a content window, FALSE otherwise. FALSE is used to remove a previously defined context window. Calling MakeContentWindow with fSet=FALSE is usually not necessary if the context window is simply destroyed. ### Comments The MakeContentWindow function defines a window as a content window for use with a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource). If the tree control doesn't use virtual mode, any calls to MakeContentWindow are ignored. The call to MakeContentWindow must occur after the total number of items has been defined (using [VirtualCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualcount)) and the tree control is otherwise completely initialized. MakeContentWindow marks the window handle as a content window. The virtual data source callback ([LPFNSFTTREE_VGETITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_vgetitem)) can then provide the content window in the hwndCell field of the [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) structure, embedded within the aCells field of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure. Calling MakeContentWindow with fSet=FALSE is usually not necessary if the context window is simply destroyed. If the content window is to be preserved for later reuse, a call to MakeContentWindow with fSet=FALSE is required. In addition, the content window must be removed from the tree control and added to another window as a child window using the Windows API SetParent. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MakeIntegralHeight *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makeintegralheight* Resizes the tree control vertically so visible items are displayed in their entirety. C ``` void WINAPI SftTree_MakeIntegralHeight(HWND hwndCtl, int maxHeight); void WINAPI SftTreeSplit_MakeIntegralHeight(HWND hwndCtl, int maxHeight); ``` C++ ``` void CSftTree::MakeIntegralHeight(int maxHeight = 0); void CSftTreeSplit::MakeIntegralHeight(int maxHeight = 0); ``` ### Parameters hwndCtl The window handle of the tree control. maxHeight The maximum allowable height of the tree control in pixels. The tree control is resized vertically to display as many items as possible in their entirety without exceeding *maxHeight*. If 0 is used, the current tree control height is used as maximum height. ### Comments The MakeIntegralHeight function resizes the tree control vertically so visible items are displayed in their entirety. MakeIntegralHeight is used to resize the tree control so it doesn't display partial items. The *maxHeight* value specifies the maximum height of the tree control to use. MakeIntegralHeight calculates the largest height of the tree control (smaller or equal to *maxHeight*) so that no partial items are displayed and resizes the control vertically using the calculated height. MakeIntegralHeight takes all tree control attributes into consideration, including the presence of a horizontal scroll bar. MakeIntegralHeight should be used after all tree control attributes have been set and all items have been added. If tree control attributes are changed after using MakeIntegralHeight, the tree control does not automatically resize if items become partially visible. MakeIntegralHeight has no effect if [variable height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) items are used. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MakeRowHeaderOptimal *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowheaderoptimal* Sets the optimal [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) width so that the text and pictures of all row headers can be displayed. C ``` int SftTree_MakeRowHeaderOptimal(HWND hwndCtl); int SftTreeSplit_MakeRowHeaderOptimal(HWND hwndCtl); ``` C++ ``` void CSftTree::MakeRowHeaderOptimal(int limit = 0, BOOL fVisibleOnly = FALSE); void CSftTreeSplit::MakeRowHeaderOptimal(int limit = 0, BOOL fVisibleOnly = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. limit Defines the maximum number of items to be considered for width calculation. Specify a number less than or equal to 0 to consider all items. If a tree control contains many items, scanning all items may be extremely slow, as each row header width needs to be calculated. Using an application defined maximum number, the calculation can be limited to *limit* items. This results in better response time, yet some items which are not within the number of scanned items may still be clipped. fVisibleOnly Specify TRUE to limit the width calculation to visible items only. Items which are not visible because their [parent items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are collapsed are not included in the width calculation. ### Comments The MakeRowHeaderOptimal function sets the optimal row header width so that the text and pictures of all row headers can be displayed. MakeRowHeaderOptimal resizes the row header area so that the row header text and row header pictures can be completely displayed without being truncated or clipped. [CalcOptimalRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalrowheaderwidth) can be used to calculate a column's optimal width without resizing the row header area. The row header width can be changed using [SetRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderwidth). The SftTree_MakeRowHeaderOptimal function does not support the parameters *limit* and *fVisibleOnly*. Use the [SetCalcLimit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calclimit) and [SetCalcVisibleOnly](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcvisibleonly) functions to supply this information before calling SftTree_MakeRowHeaderOptimal. By changing tree control attributes, the optimal row header width may change. Adding items, setting new row header pictures and changing row header text are a few of the actions that can affect the optimal row header width. The row header width may have to be set again to allow items to be completely visible. The tree control does not automatically adjust the row header width. Items can be excluded from optimal row header width calculation by using the [SetItemIgnore](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemignore) function or for [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode), setting the [SFTTREEITEM_IGNORE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) value in the *flag2* member of the SFTTREE_ITEM structure. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MakeRowVisible *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowvisible* Scrolls the specified item into view vertically so that it is displayed in the tree control's client area. C ``` void WINAPI SftTree_MakeRowVisible(HWND hwndCtl, int index); void WINAPI SftTreeSplit_MakeRowVisible(HWND hwndCtl, int index); ``` C++ ``` void CSftTree::MakeRowVisible(int index); void CSftTreeSplit::MakeRowVisible(int index); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item to scroll into view. ### Comments The MakeRowVisible function scrolls the specified item into view vertically so that it is displayed in the tree control's client area. MakeRowVisible can be used to make an item visible by scrolling it into view (vertically). The user normally scrolls the tree control items vertically using the scroll bar, but an application can use MakeRowVisible to insure that an item is visible. [SetTopIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_topindex) is used to make a specific item the very first item shown in the tree control area. To make a particular [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) or column visible use [MakeCellVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecellvisible) or [MakeColumnVisible](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnvisible). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MakeSplitterOptimal *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makesplitteroptimal* Positions the [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) optimally, so the left pane can display as much data as possible without a horizontal scroll bar. C ``` void WINAPI SftTreeSplit_MakeSplitterOptimal(HWND hwndCtl); ``` C++ ``` void CSftTreeSplit::MakeSplitterOptimal(); ``` ### Parameters hwndCtl The window handle of the tree control. ### Comments The MakeSplitterOptimal function positions the splitter bar optimally, so the left pane can display as much data as possible without a horizontal scroll bar. MakeSplitterOptimal is only available for a split tree control. Before using MakeSplitterOptimal, the best horizontal extent for the panes must be set using [SetHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontalextent) or [RecalcHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_recalchorizontalextent). Once set, MakeSplitterOptimal can then be used to position the splitter bar optimally, so the left pane can display as much data as possible without a horizontal scroll bar. MakeSplitterOptimal uses the current width of the tree control window to determine the allowable position of the splitter bar. If the tree control window is too small, the splitter bar may not be optimally set. This is particularly noticeable if the tree control window is resized after MakeSplitterOptimal is used. The coordinates of the splitter bar can be retrieved using [GetSplitterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterrect). [SetSplitterWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterwidth) is used to change the width of the splitter bar. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MoveItem *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_moveitem* MoveItem is provided for compatibility with SftTree/DLL 4.5 (and earlier) only. Applications should use the [MoveItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_moveitems) function instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MoveItems *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_moveitems* Moves a group of items to a new position in the tree control. C ``` int WINAPI SftTree_MoveItems(HWND hwndCtl, int from, int count, int to); int WINAPI SftTreeSplit_MoveItems(HWND hwndCtl, int from, int count, int to); ``` C++ ``` int CSftTree::MoveItems(int from, int count, int to); int CSftTreeSplit::MoveItems(int from, int count, int to); ``` ### Parameters hwndCtl The window handle of the tree control. from The zero-based index of the first item to be moved. count The number of items to be moved. to The zero-based index of the location where the moved items are to be inserted. If *to* is -1, the items will be added at the end of the list. ### Returns The return value is the number of moved items or -1 if an error occurred. ### Comments The MoveItems function moves a group of items to a new position in the tree control. MoveItems moves all item attributes, including [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text), pictures, level, [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) contents, etc. An item's [dependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) are not moved unless they are included in *count*. If any dependent items are not included in *count*, they are removed if their [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) is collapsed. They are not removed if the parent item is expanded. Items can be copied using [CopyItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_copyitems). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used and an error is returned. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MultilineFooter *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilinefooter* Defines whether [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) can display multiple lines of text. C ``` BOOL WINAPI SftTree_GetMultilineFooter(HWND hwndCtl); void WINAPI SftTree_SetMultilineFooter(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetMultilineFooter(HWND hwndCtl); void WINAPI SftTreeSplit_SetMultilineFooter(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetMultilineFooter() const; void CSftTree::SetMultilineFooter(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetMultilineFooter() const; void CSftTreeSplit::SetMultilineFooter(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to allow multiple lines of text in column footers, otherwise set to FALSE. ### Returns GetMultilineFooter returns TRUE if multiple lines of text are allowed, otherwise FALSE is returned. ### Comments The GetMultilineFooter and SetMultilineFooter functions define whether column footers can display multiple lines of text. Column footer text is defined using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex), *lpszFooterTitle*). [Footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footer) text and [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) text can contain multiple lines of text using cr-lf (\r\n). SetMultilineFooter must be used to enable multiple lines of text. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## MultilineHeader *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilineheader* Defines whether [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) can display multiple lines of text. C ``` BOOL WINAPI SftTree_GetMultilineHeader(HWND hwndCtl); void WINAPI SftTree_SetMultilineHeader(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetMultilineHeader(HWND hwndCtl); void WINAPI SftTreeSplit_SetMultilineHeader(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetMultilineHeader() const; void CSftTree::SetMultilineHeader(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetMultilineHeader() const; void CSftTreeSplit::SetMultilineHeader(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to allow multiple lines of text in column headers, otherwise set to FALSE. ### Returns GetMultilineHeader returns TRUE if multiple lines of text are allowed, otherwise FALSE is returned. ### Comments The GetMultilineHeader and SetMultilineHeader functions define whether column headers can display multiple lines of text. Column header text is defined using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex), *lpszTitle*). [Header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_header) text and [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) text can contain multiple lines of text using cr-lf (\r\n). SetMultilineHeader must be used to enable multiple lines of text. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## NextShown *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nextshown* Returns the next visible item. C ``` int WINAPI SftTree_GetNextShown(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetNextShown(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetNextShown(int index) const; int CSftTreeSplit::GetNextShown(int index) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item after which the next visible item should be located. To locate the first visible item (if present) in a tree control specify -1. ### Returns The return value is the index of the next visible item or -1 if no item is visible. ### Comments The GetNextShown function returns the next visible item. GetNextShown is used to find the next visible item, given an item index. [Dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependent) items of a collapsed [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are skipped using this function. [GetPrevShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_prevshown) can be used to retrieve the previous visible item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## NoFocusStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nofocusstyle* Defines the display style of selected items when the tree control does not have the input focus. C ``` int WINAPI SftTree_GetNoFocusStyle(HWND hwndCtl); void WINAPI SftTree_SetNoFocusStyle(HWND hwndCtl, int NoFocusStyle); int WINAPI SftTreeSplit_GetNoFocusStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetNoFocusStyle(HWND hwndCtl, int NoFocusStyle); ``` C++ ``` int CSftTree::GetNoFocusStyle() const; void CSftTree::SetNoFocusStyle(int type); int CSftTreeSplit::GetNoFocusStyle() const; void CSftTreeSplit::SetNoFocusStyle(int type); ``` ### Parameters hwndCtl The window handle of the tree control. NoFocusStyle A value describing the display style of selected items when the tree control does not have the input focus: | | | | --- | --- | | SFTTREE_NOFOCUS_KEEPSEL | The selected items are drawn the same way as for a tree control that has the input focus. If a rounded selection outline rectangle is used (see [SFTTREE_SELECTION_OUTLINE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle)), the colors used are defined using the *nofocusOutlineBorder*, * nofocusInnerBorder*, *nofocusInnerFill1* and *nofocusInnerFill2* members of the [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors) structure. Otherwise, the *colorSelBgNoFocus* and *colorSelFgNoFocus* members are used. If these colors are identical to the colors * selectionOutlineBorder*, *selectionInnerBorder*, * selectionInnerFill1*, *selectionInnerFill2 *or *colorSelBg* and *colorSelBgNoFocus*, the user cannot distinguish between selected items in an active tree control and an inactive control. | | SFTTREE_NOFOCUS_FRAME | The selected items are drawn as items that are not selected, but are framed by a rectangle drawn using the color specified by the *colorSelBg* member of the SFTTREE_COLORS structure. If a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE), SFTTREE_NOFOCUS_FRAME is identical to SFTTREE_NOFOCUS_KEEPSEL. | | SFTTREE_NOFOCUS_NOTHING | The selected items are drawn as items that are not selected. The user cannot distinguish between selected items and items that are not selected in an inactive tree control. | ### Returns GetNoFocusStyle returns a value describing the display style of selected items when the tree control does not have the input focus. ### Comments The GetNoFocusStyle and SetNoFocusStyle functions define the display style of selected items when the tree control does not have the input focus. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## NoSelection *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_noselection* GetNoSelection/SetNoSelection is provided for compatibility with SftTree/DLL 4.0 (and earlier) only. Applications should use the [SetSelectionArea](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionarea) function instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## OpenEnded *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_openended* Defines whether the last column is open-ended. C ``` BOOL WINAPI SftTree_GetOpenEnded(HWND hwndCtl); void WINAPI SftTree_SetOpenEnded(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetOpenEnded(HWND hwndCtl, BOOL fLeft); void WINAPI SftTreeSplit_SetOpenEnded(HWND hwndCtl, BOOL fSet, BOOL fLeft); ``` C++ ``` BOOL CSftTree::GetOpenEnded() const; void CSftTree::SetOpenEnded(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetOpenEnded(BOOL fLeft = TRUE) const; void CSftTreeSplit::SetOpenEnded(BOOL fSet = TRUE, BOOL fLeft = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to define the last column as open-ended. Set to FALSE to use the column width defined in the last column's [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) structure. fLeft Set to TRUE to return or set a value defining the last column on the left side of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) (the portion of the tree control containing the hierarchy) as open-ended. If FALSE is specified, the open-ended status of the last column on the right side is returned or set. ### Returns GetOpenEnded returns TRUE if the last column is open-ended, otherwise FALSE is returned. ### Comments The GetOpenEnded and SetOpenEnded functions define whether the last column is open-ended. An open-ended last column always uses at least the defined column width or the space remaining between the previous column and the right edge of the control. A fixed-width last column is defined with a specified width and any data which doesn't fit is truncated. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## OverheadWidth *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_overheadwidth* Returns the width of the area added to the first column for hierarchical graphics components. C ``` int WINAPI SftTree_GetOverheadWidth(HWND hwndCtl); int WINAPI SftTreeSplit_GetOverheadWidth(HWND hwndCtl); ``` C++ ``` int CSftTree::GetOverheadWidth() const; int CSftTreeSplit::GetOverheadWidth() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the width (in pixels) of the area reserved for non-[cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) displays, such as [label pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap), [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons), [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines) and [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) for all items. ### Comments The GetOverheadWidth function returns the width of the area added to the first column for hierarchical graphics components. Due to the variable number of levels and the resulting hierarchical display, the width of the first column is always treated as a minimum width. The text portion of the first column will always be at least of the width specified using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns), no matter what level the item is on. This can result in the first column being much wider than the defined width. To calculate the actual width of column 0, add the value returned by GetOverheadWidth to the width of column 0 as returned by GetColumns. GetOverheadWidth returns the width of the area reserved for non-cell displays, such as label pictures, expand/collapse buttons, tree lines and item pictures for all items. If more levels are added to a hierarchy, the value increases. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## OwnerDrawCallback *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback* Defines an application-supplied owner-draw function, which is called whenever an object needs to be rendered. C ``` BOOL WINAPI SftTree_SetOwnerDrawCallback(HWND hwndCtl, LPCSFTTREE_OWNERDRAWPARM lpDrawInfo); BOOL WINAPI SftTreeSplit_SetOwnerDrawCallback(HWND hwndCtl, LPCSFTTREE_OWNERDRAWPARM lpDrawInfo); ``` C++ ``` BOOL CSftTree::SetOwnerDrawCallback(LPCSFTTREE_OWNERDRAWPARM lpDrawInfo); BOOL CSftTreeSplit::SetOwnerDrawCallback(LPCSFTTREE_OWNERDRAWPARM lpDrawInfo); ``` ### Parameters hwndCtl The window handle of the tree control. lpDrawInfo A pointer to a [SFTTREE_OWNERDRAWPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdrawparm) structure containing the parameters for this function to register a callback function and user supplied data. This parameter may be NULL to stop using the callback function. The SFTTREE_OWNERDRAWPARM structure contains the following members: | | | | --- | --- | | [LPFNSFTTREE_OWNERDRAWPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_ownerdrawproc) lpfnOwnerDrawProc | A user supplied routine which is called every time an object needs to be rendered. | | [SFTTREE_DWORD_PTR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_dword_ptr) OwnerDrawUserData | User supplied, application-specific data. | ### Returns The return value is TRUE if the function was successful, otherwise FALSE if an error occurred. ### Comments The SetOwnerDrawCallback function defines an application-supplied owner-draw function, which is called whenever an object needs to be rendered. The callback receives control when an object needs to be rendered. The callback can then perform application specific rendering of the object. An application can render [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), cell [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips), [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers), [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) and [row/column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) using the owner-draw function. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Parent *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_parent* Returns an item's [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) index. C ``` int WINAPI SftTree_GetParent(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetParent(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetParent(int index) const; int CSftTreeSplit::GetParent(int index) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the parent item index is to be retrieved. ### Returns The return value is the zero-based index of the immediate parent item. -1 is returned if the item requested doesn't have a parent or if an error occurred. ### Comments The GetParent function returns an item's parent index. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Pictures *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures* Registers the size and sets the default [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) used for all items. C ``` void WINAPI SftTree_GetPictures(HWND hwndCtl, LPSFT_PICTURE lpPics); BOOL WINAPI SftTree_SetPictures(HWND hwndCtl, LPCSFT_PICTURE lpPics); void WINAPI SftTreeSplit_GetPictures(HWND hwndCtl, LPSFT_PICTURE lpPics); BOOL WINAPI SftTreeSplit_SetPictures(HWND hwndCtl, LPCSFT_PICTURE lpPics); ``` C++ ``` void CSftTree::GetPictures(LPSFT_PICTURE lpPics) const; BOOL CSftTree::SetPictures(int val = 0); BOOL CSftTree::SetPictures(LPCSFT_PICTURE lpPics); void CSftTreeSplit::GetPictures(LPSFT_PICTURE lpPics) const; BOOL CSftTreeSplit::SetPictures(int val = 0); BOOL CSftTreeSplit::SetPictures(LPCSFT_PICTURE lpPics); ``` ### Parameters hwndCtl The window handle of the tree control. lpPics A pointer to three [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) structures to be used as default item pictures. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, all item pictures must be the same size, but can be different types. It is possible to mix bitmaps, icons and ImageList images. These three pictures are used as default item pictures for 1) an expandable [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent), 2) an expanded parent item and 3) a [leaf item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_leaf). If the SFT_PICTURE structure describes a bitmap handle, the top, left pixel of each bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL or omitted to stop displaying item bitmaps. val The only allowable value is 0, which is used to stop displaying item pictures. ### Returns SetPictures returns TRUE if the function was successful, otherwise FALSE. GetPictures has no return value. ### Comments The GetPictures function returns the default item pictures previously registered using SetPictures. The SetPictures function registers the size and sets the default item pictures used for all items. There are no default item pictures. Get/SetPictures can be used to define default item pictures using a bitmaps, icons or ImageList images. Get/[SetBitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_bitmaps) can be used to define default item pictures using bitmap handles only. In a fixed height tree control, all item pictures used for all items must be the same size. New pictures can be registered at any time, but all item pictures in use must be replaced by pictures of the new size. In a variable height tree control, item pictures can be of varying sizes. The largest picture size must be registered using SetBitmaps. Item pictures defined using [SetItemPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicture) must be of equal or smaller size. Individual item pictures can be set using SetItemPicture, but will not be shown unless default pictures have been registered using SetPictures. The height of all [tree items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_items) is adjusted automatically to allow the complete picture to be displayed. The default pictures can be changed even after items have been added to the tree control. Items without individual item bitmap will immediately use the new default bitmaps. The application retains ownership of any resources used to define the picture and cannot free these resources until the tree control no longer uses these (usually until the tree control is destroyed or the pictures are changed). An individual item's item picture can be defined using SetItemPicture. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## PixelScaling *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pixelscaling* Defines how caller-supplied pixel dimensions (column widths, indentation, etc.) are interpreted relative to the current monitor DPI. C ``` void WINAPI SftTree_SetPixelScaling(HWND hwndCtl, int mode); int WINAPI SftTree_GetPixelScaling(HWND hwndCtl); void WINAPI SftTreeSplit_SetPixelScaling(HWND hwndCtl, int mode); int WINAPI SftTreeSplit_GetPixelScaling(HWND hwndCtl); ``` C++ ``` void CSftTree::SetPixelScaling(int mode); int CSftTree::GetPixelScaling() const; void CSftTreeSplit::SetPixelScaling(int mode); int CSftTreeSplit::GetPixelScaling() const; ``` ### Parameters hwndCtl The window handle of the tree control. mode Defines the [pixel scaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dpi) mode. *mode* can be one of the following values: | | | | --- | --- | | SFTTREE_PIXELSCALING_ASIS | Caller-supplied pixel dimensions are used verbatim, in physical screen pixels. This is the default and preserves the traditional SftTree/DLL behavior. A column width of 100 is 100 screen pixels on any monitor. | | SFTTREE_PIXELSCALING_STRETCH | Caller-supplied pixel dimensions are interpreted as 96-DPI reference pixels and are scaled by the factor *currentDPI / 96* each time they are used. A column width of 100 set on a 96-DPI monitor is 100 screen pixels at 100%, 150 pixels at 150%, 200 pixels at 200%. Storage and the corresponding Get* functions always return the value in caller-reference (96-DPI) units. | ### Returns GetPixelScaling returns a value indicating the current pixel scaling mode (SFTTREE_PIXELSCALING_ASIS or SFTTREE_PIXELSCALING_STRETCH). ### Comments The SetPixelScaling and GetPixelScaling functions define how caller-supplied pixel dimensions are interpreted relative to the current monitor DPI. The setting affects the following caller-supplied values: - column widths (*width* and *minWidth* in [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex)), - indentation ([SetIndentation](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_indentation)), - [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) width ([SetRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderwidth)), - horizontal extent and offset ([SetHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontalextent), [SetHorizontalOffset](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontaloffset)), - item minimum and maximum heights ([SetItemHeightMinMax](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheightminmax), *minHeight* and *maxHeight* in [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item)), - the split tree's splitter offset ([SetSplitterOffset](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffset), [SetSplitterOffsetMin](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffsetmin)). SetPixelScaling is independent of [SetImageScaling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_imagescaling). SetPixelScaling controls how caller-supplied pixel dimensions are interpreted; SetImageScaling controls the size at which images are drawn. Either can be used without the other. SFTTREE_PIXELSCALING_ASIS (the default) preserves back-compatible behavior. A column width of 100 set on a 96-DPI monitor is 100 pixels on any monitor - useful when the application is already DPI-aware and performs its own scaling, but means the column appears physically smaller on high-DPI monitors. SFTTREE_PIXELSCALING_STRETCH makes caller-supplied pixel values resolution-independent. Column widths, indentation and row-header widths stay physically the same size as the user moves between monitors of different DPI. Because storage and the corresponding Get* functions always return caller-reference units, serialized configurations remain portable between machines of different DPI and between different monitors of the same machine. [Splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) *width* ([SetSplitterWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterwidth)) is always scaled with DPI and is not affected by this setting, as it is a control-owned rendering metric rather than a caller-supplied dimension. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## PlusMinus *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_plusminus* Defines the [plus/minus bitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_plusminus_bitmap) used for all items. C ``` BOOL WINAPI SftTree_SetPlusMinus(HWND hwndCtl, HBITMAP *lphBitmap); BOOL WINAPI SftTreeSplit_SetPlusMinus(HWND hwndCtl, HBITMAP *lphBitmap); ``` C++ ``` BOOL CSftTree::SetPlusMinus(int val = 0); BOOL CSftTree::SetPlusMinus(const CBitmap Bitmap[3]); BOOL CSftTreeSplit::SetPlusMinus(int val = 0); BOOL CSftTreeSplit::SetPlusMinus(const CBitmap Bitmap[3]); ``` ### Parameters hwndCtl The window handle of the tree control. lphBitmap, Bitmap A pointer to three bitmap handles or an array of three CBitmap objects for bitmaps of equal size. These three bitmaps are used as plus/minus bitmaps for 1) an expandable [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent), 2) an expanded parent item and 3) a [leaf item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_leaf). The top, left pixel of each bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL to stop displaying plus/minus bitmaps. val The only allowable value is 0, which is used to stop displaying plus/minus bitmaps. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SetPlusMinus function defines the plus/minus bitmaps used for all items. There are no predefined default plus/minus bitmaps. All plus/minus bitmaps must be the same size. Plus/minus bitmaps will not be shown unless bitmaps have been registered using this function. The height of all [tree items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_items) is adjusted automatically to allow the complete bitmap to be displayed. The bitmaps can be changed even after items have been added to the tree control. The new bitmaps will immediately be used. The application retains ownership of the bitmaps, and cannot delete the bitmaps until the tree control no longer uses the bitmaps (usually until the tree control is destroyed or the bitmaps are changed using SetPlusMinus). [GetShowPlusMinus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showplusminus) can be used to determine if plus/minus bitmaps are shown. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## PrevShown *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_prevshown* Returns the previous visible item. C ``` int WINAPI SftTree_GetPrevShown(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetPrevShown(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetPrevShown(int index) const; int CSftTreeSplit::GetPrevShown(int index) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item before which the previous visible item should be located. To locate the last visible item (if present) in a tree control specify -1. ### Returns The return value is the index of the previous visible item or -1 if no item is visible. ### Comments The GetPrevShown function returns the previous visible item. GetPrevShown is used to find the previous visible item, given an item index. [Dependent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dependent) items of a collapsed [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are skipped using this function. [GetNextShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nextshown) can be used to retrieve the next visible item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RealColumn *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_realcolumn* Returns the [real column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) given a display column number. C ``` int WINAPI SftTree_GetRealColumn(HWND hwndCtl, int dispCol); int WINAPI SftTreeSplit_GetRealColumn(HWND hwndCtl, int dispCol); ``` C++ ``` int CSftTree::GetRealColumn(int dispCol) const; int CSftTreeSplit::GetRealColumn(int dispCol) const; ``` ### Parameters hwndCtl The window handle of the tree control. dispCol The display column number whose real column number is to be returned. ### Returns The return value is the real column number for a display column number, or -1 if an error occurred. ### Comments The GetRealColumn function returns the real column number given a display column number. As a user reorders [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns), this is completely transparent to the application. An application still references [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) by the "real" column number, which is the original column number that the cell had before columns were reordered by the user. While columns appear in a new order after dragging a column to a new position, the application references columns and cells by their real column number which never changes. If a user reorders columns using [column drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_drag_drop), the (display) column numbers, which is the column number as it appears to the user, may need to be translated into the real column number as used by an application. For more information see section "Display vs. Real Columns". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RecalcHorizontalExtent *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_recalchorizontalextent* Recalculates the optimal [horizontal scrolling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_horizontalscrolling) extent. C ``` void WINAPI SftTree_RecalcHorizontalExtent(HWND hwndCtl); void WINAPI SftTreeSplit_RecalcHorizontalExtent(HWND hwndCtl); ``` C++ ``` void CSftTree::RecalcHorizontalExtent(int limit = 0, BOOL fVisibleOnly = FALSE); void CSftTreeSplit::RecalcHorizontalExtent(int limit = 0, BOOL fVisibleOnly = FALSE); ``` ### Parameters hwndCtl The window handle of the tree control. limit Defines the maximum number of items to be considered for width calculation. Specify a number less than or equal to 0 to consider all items. If a tree control contains many items, scanning all items may be extremely slow, as each [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell)'s width needs to be calculated. Using an application defined maximum number, the calculation can be limited to *limit* items. This results in better response time, yet some items which are not within the number of scanned items may still be clipped. fVisibleOnly Specify TRUE to limit the width calculation to visible items only. Items which are not visible because their [parent items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) are collapsed are not included in the width calculation. ### Comments The RecalcHorizontalExtent function recalculates the optimal horizontal scrolling extent. By default, a tree control does not handle horizontal scrolling, even if the WS_HSCROLL [window style](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) is defined. To start horizontal scrolling, an application should use RecalcHorizontalExtent or [SetHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_horizontalextent). The SftTree_RecalcHorizontalExtent function does not support the parameters *limit* and *fVisibleOnly*. Use the [SetCalcLimit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calclimit) and [SetCalcVisibleOnly](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcvisibleonly) functions to supply this information before calling SftTree_RecalcHorizontalExtent. Based on the definition of the last column, different algorithms are used to calculate the optimal scrolling extent. Using [SetOpenEnded](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_openended), the last column can be defined as *open-ended*. An open-ended last column will display the complete text specified for the last (or only) column and never truncate any data. A *fixed-width* last column is defined with a specified width and any data which doesn't fit is truncated. **Open-ended Last Column** Recalculating the best horizontal scrolling extent can be a costly operation (in terms of elapsed time). When updating a tree control, it is best to delay using RecalcHorizontalExtent as much as possible. It is best done after all items have been added, their levels have been set and all necessary pictures and tree control attributes have been defined, because most changes to the tree control can invalidate the optimal horizontal scrolling extent calculated. When calculating the optimal scrolling extent, each item will be analyzed and its length calculated using the item's [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) component and its level. The widest item determines the horizontal scrolling extent. If the text component is not available for this calculation because it is supplied by a drawing callback routine, then this function calculates the widest item without considering the text component. It is up to the application to increase the calculated horizontal scrolling extent by using SetHorizontalExtent. **Fixed-Width Last Column** Recalculating the best horizontal scrolling extent is a very quick operation. The width of all [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) and some initial overhead (based on the highest level number found) is calculated to determine the horizontal scrolling extent. No item text is analyzed. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RegisterApp *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_registerapp* Registers an application with SftTree/DLL. C ``` BOOL WINAPI SftTree_RegisterApp(HINSTANCE hInst); ``` C++ ``` static BOOL CSftTree::RegisterApp(); ``` ### Parameters hInst The instance handle of the application, which will use SftTree/DLL controls. ### Returns The return value is TRUE if SftTree/DLL has been initialized for this application, otherwise FALSE is returned. ### Comments The RegisterApp function registers an application with SftTree/DLL. This call allows SftTree/DLL to register all required window classes for the calling application. This call has to be made before any SftTree/DLL controls are created. If an application has multiple threads which **create** controls, each thread must also call RegisterApp to initialize support for SftTree/DLL. If only the main thread of a process creates controls (even if other threads communicate with the control), no additional calls to RegisterApp are required. An application should call [UnregisterApp](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_unregisterapp) once the application no longer uses SftTree/DLL controls. In addition, each thread that called RegisterApp during initialization must call UnregisterApp before the thread terminates. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ReorderColumns *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_reordercolumns* Defines whether [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) can be reordered using [column drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_drag_drop). C ``` BOOL WINAPI SftTree_GetReorderColumns(HWND hwndCtl); void WINAPI SftTree_SetReorderColumns(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetReorderColumns(HWND hwndCtl); void WINAPI SftTreeSplit_SetReorderColumns(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetReorderColumns() const; void CSftTree::SetReorderColumns(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetReorderColumns() const; void CSftTreeSplit::SetReorderColumns(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to enable column reordering, otherwise set to FALSE. ### Returns GetReorderColumns returns TRUE if columns can be reordered by the user using the mouse, otherwise FALSE is returned. ### Comments The GetReorderColumns and SetReorderColumns functions define whether columns can be reordered using column drag & drop. Individual columns can be locked in place even if column reordering is in effect, by adding the [SFTTREE_COL_KEEPPOS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) value to the *colFlag* member of the SFTTREE_COLUMN_EX structure. SFTTREE_COL_KEEPPOS causes the column to remain in the current display position. If an application wants to retain the column order between sessions, the *dispPos* member of the SFTTREE_COLUMN_EX structure must be saved for each column. When the application is restarted and the tree control is reinitialized, the values of the *dispPos* member can be restored for each column before calling [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns). An INI file or the Windows Registry can be used to save these values. In a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) columns can only be reordered within the left side or the right side. It is not possible to drag columns from one pane to the other. Also see the section "Column Drag & Drop" for additional information. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ResetContent *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resetcontent* Removes all items from the tree control. C ``` void WINAPI SftTree_ResetContent(HWND hwndCtl); void WINAPI SftTreeSplit_ResetContent(HWND hwndCtl); ``` C++ ``` void CSftTree::ResetContent(); void CSftTreeSplit::ResetContent(); ``` ### Parameters hwndCtl The window handle of the tree control. ### Comments The ResetContent function removes all items from the tree control. If a deletion callback routine has been defined (see [SetDeleteCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletecallback)), the callback is invoked for each item as it is deleted from the tree control. This allows application specific cleanup processing to take place for each item. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), this function cannot be used. [VirtualCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualcount) can be used to change the number of items in a virtual data source. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ResetSortIndicators *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resetsortindicators* Removes all [sort indicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_sortindicator) from all [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns). C ``` void WINAPI SftTree_ResetSortIndicators(HWND hwndCtl); void WINAPI SftTreeSplit_ResetSortIndicators(HWND hwndCtl); ``` C++ ``` void CSftTree::ResetSortIndicators(); void CSftTreeSplit::ResetSortIndicators(); ``` ### Parameters hwndCtl The window handle of the tree control. ### Comments The ResetSortIndicators function removes all sort indicators from all columns. The sort order of the [tree items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_items) is not changed. Only the visual sort indicators are removed. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ResizeColumn *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizecolumn* Returns the column number of the column being resized. C ``` int WINAPI SftTree_GetResizeColumn(HWND hwndCtl); int WINAPI SftTreeSplit_GetResizeColumn(HWND hwndCtl); ``` C++ ``` int CSftTree::GetResizeColumn() const; int CSftTreeSplit::GetResizeColumn() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns GetResizeColumn returns the zero-based column number of the column being affected by the current [notification](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications). If a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) is used, the return value can be -1 indicating that the splitter bar was used to resize the left and right panes or the splitter bar was double-clicked. ### Comments The GetResizeColumn function returns the column number of the column being resized. GetResizeColumn can be used while processing a SFTTREEN_COLUMNSIZE or SFTTREEN_LBUTTONDBLCLK_COLUMNRES notification to determine whether the splitter bar or a column was affected by the current event. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## ResizeFooter *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizefooter* Defines whether [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) are resizable by the user. C ``` BOOL WINAPI SftTree_GetResizeFooter(HWND hwndCtl); void WINAPI SftTree_SetResizeFooter(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetResizeFooter(HWND hwndCtl); void WINAPI SftTreeSplit_SetResizeFooter(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetResizeFooter() const; void CSftTree::SetResizeFooter(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetResizeFooter() const; void CSftTreeSplit::SetResizeFooter(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to enable footer and [column resizing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_resizing), otherwise set to FALSE. ### Returns GetResizeFooter returns TRUE if column footers are resizable using the mouse, otherwise FALSE is returned. ### Comments The GetResizeFooter and SetResizeFooter functions define whether column footers are resizable by the user. [Columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) can only be resized by the user if [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) or column footers are visible (see [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ResizeHeader *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizeheader* Defines whether [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are resizable by the user. C ``` BOOL WINAPI SftTree_GetResizeHeader(HWND hwndCtl); void WINAPI SftTree_SetResizeHeader(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetResizeHeader(HWND hwndCtl); void WINAPI SftTreeSplit_SetResizeHeader(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetResizeHeader() const; void CSftTree::SetResizeHeader(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetResizeHeader() const; void CSftTreeSplit::SetResizeHeader(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to enable header and [column resizing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_resizing), otherwise set to FALSE. ### Returns GetResizeHeader returns TRUE if column headers are resizable using the mouse, otherwise FALSE is returned. ### Comments The GetResizeHeader and SetResizeHeader functions define whether column headers are resizable by the user. [Columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) can only be resized by the user if column headers or [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) are visible (see [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RightWindow *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rightwindow* Returns the window handle or object of the tree control in the right pane of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). C ``` HWND WINAPI SftTreeSplit_GetRightWindow(HWND hwndCtl); ``` C++ ``` CSftTree* CSftTreeSplit::GetRightWindow() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the window handle of the tree control in the right pane of a split tree control. ### Comments The GetRightWindow function returns the window handle or object of the tree control in the right pane of a split tree control. GetRightWindow is only available for a split tree control. The left and right panes of a split tree control are independent tree controls, which communicate with each other to keep their display styles and data contents synchronized. These tree controls are child windows of the split tree control. While the left and right panes exchange information to keep their display and attributes updated, it is possible to affect each pane individually through the window handle or object. Each pane of a split tree control uses a tree control (of the window class [SFTTREE_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_class) or C++ class [CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api)) to display the requested [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) (see [SetSplitColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitcolumn)). Occasionally it may be necessary to manipulate the tree control in a pane directly, rather than the main split tree control (of the window class [SFTTREESPLIT_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttreesplit_class) or class CSftTreeSplit). For example, setting the split tree control's font (using the WM_SETFONT message or CWnd::SetFont) will affect both panes of the split tree control. An application could set different fonts for the two panes by using [GetLeftWindow](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_leftwindow) and GetRightWindow and setting the fonts for each pane. Or, an application could turn on [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines) for the right pane and turn them off for the left pane. [SetShowGrid](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showgrid) will affect both panes if used for the split tree control, but using GetLeftWindow and GetRightWindow, the individual panes can be defined with different attributes. Certain operations on individual panes are possible, but should never be performed. For example, accessing a pane to add or delete items is possible, but will result in unexpected behavior of the split tree control. Or turning off [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) in one pane, but not the other causes misalignment of the items displayed in each pane. In general, directly accessing a pane should rarely be necessary. See Also C/C++ API | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColBitmap *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmap* Defines the picture displayed in the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). C ``` HBITMAP WINAPI SftTree_GetRowColBitmap(HWND hwndCtl); void WINAPI SftTree_SetRowColBitmap(HWND hwndCtl, HBITMAP hBitmap); HBITMAP WINAPI SftTreeSplit_GetRowColBitmap(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColBitmap(HWND hwndCtl, HBITMAP hBitmap); ``` C++ ``` CBitmap* CSftTree::GetRowColBitmap() const; void CSftTree::SetRowColBitmap(int val = 0); void CSftTree::SetRowColBitmap(const CBitmap& Bitmap); CBitmap* CSftTreeSplit::GetRowColBitmap() const; void CSftTreeSplit::SetRowColBitmap(int val = 0); void CSftTreeSplit::SetRowColBitmap(const CBitmap& Bitmap); ``` ### Parameters hwndCtl The window handle of the tree control. hBitmap, Bitmap A bitmap handle or a reference to a CBitmap object to be used as row/column header picture. The top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL to remove the row/column header picture. val The only allowable value is 0, which is used to stop displaying the row/column header picture. ### Returns GetRowColBitmap returns the bitmap used to draw the row/column header, or NULL if the row/column header doesn't have a defined bitmap. ### Comments The GetRowColBitmap and SetRowColBitmap functions define the picture displayed in the row/column header. Get/SetRowColBitmap can be used to define a row/column picture using a bitmap handle only. Get/[SetRowColHeaderPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicture) can be used to define a row/column picture using a bitmap, icon or ImageList image. The dimensions of the picture are used to calculate the minimum dimension for the [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers), [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) and row/column headers, so pictures displayed in row headers, column headers and row/column headers are never clipped vertically. The horizontal and vertical alignment of the row/column picture is defined using [RowColHeaderPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicturestyle). The row/column header area is only shown if row headers and column headers are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColBitmapStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmapstyle* Defines the position of the picture displayed in the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). C ``` DWORD WINAPI SftTree_GetRowColBitmapStyle(HWND hwndCtl); void WINAPI SftTree_SetRowColBitmapStyle(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetRowColBitmapStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColBitmapStyle(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetRowColBitmapStyle() const; void CSftTree::SetRowColBitmapStyle(DWORD style); DWORD CSftTreeSplit::GetRowColBitmapStyle() const; void CSftTreeSplit::SetRowColBitmapStyle(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style The picture location relative to the row/column header text. One value of each of the following tables can be combined and passed as *style* parameter. | style | Horizontal row/column header picture alignment | | --- | --- | | SFTTREE_BMP_LEFT | The row/column header picture is displayed to the left of the header text. If no horizontal row/column header picture alignment value is specified, SFTTREE_BMP_LEFT is assumed. | | SFTTREE_BMP_CENTER | The row/column header picture is displayed in the center of the row/column header, the row/column header text is not shown. | | SFTTREE_BMP_RIGHT | The row/column header picture is displayed to the right of the row/column header text. | | style | Vertical row/column header picture alignment | | --- | --- | | SFTTREE_BMP_VCENTER | The row/column header picture is vertically centered within the row/column header. If no vertical row/column header alignment value is specified, SFTTREE_BMP_VCENTER is assumed. | | SFTTREE_BMP_TOP | The row/column header picture is vertically aligned with the top of the row/column header. | | SFTTREE_BMP_BOTTOM | The row/column header picture is vertically aligned with the bottom of the row/column header. | ### Returns GetRowColBitmapStyle returns a value indicating the position of the picture displayed in the row/column header. ### Comments The GetRowColBitmapStyle and SetRowColBitmapStyle functions define the position of the picture displayed in the row/column header. The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). Get/[SetRowColHeaderPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicturestyle) is a synonym for Get/SetRowColBitmapStyle. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColFooterButton *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterbutton* Defines whether the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) button is currently down (pressed). C ``` BOOL WINAPI SftTree_GetRowColFooterButton(HWND hwndCtl); void WINAPI SftTree_SetRowColFooterButton(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetRowColFooterButton(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColFooterButton(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetRowColFooterButton() const; void CSftTree::SetRowColFooterButton(BOOL fSet); BOOL CSftTreeSplit::GetRowColFooterButton() const; void CSftTreeSplit::SetRowColFooterButton(BOOL fSet); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display the row/column footer button is in its "down" position, set to FALSE to display it in its "up", unpressed state. ### Returns GetRowColFooterButton returns TRUE if the row/column footer button is in its "down" position, otherwise FALSE is returned. ### Comments The GetRowColFooterButton and SetRowColFooterButton functions define whether the row/column footer button is currently down (pressed). This function can only be used if the row/column footer is displayed as a button (see [SetShowRowColFooterButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowcolfooterbutton)). The row/column footer area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColFooterPicture *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterpicture* Defines the picture displayed in the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer). C ``` BOOL WINAPI SftTree_GetRowColFooterPicture(HWND hwndCtl, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTree_SetRowColFooterPicture(HWND hwndCtl, LPCSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_GetRowColFooterPicture(HWND hwndCtl, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_SetRowColFooterPicture(HWND hwndCtl, LPCSFT_PICTURE lpPicture); ``` C++ ``` BOOL CSftTree::GetRowColFooterPicture(LPSFT_PICTURE lpPicture) const; BOOL CSftTree::SetRowColFooterPicture(LPCSFT_PICTURE lpPicture); BOOL CSftTreeSplit::GetRowColFooterPicture(LPSFT_PICTURE lpPicture) const; BOOL CSftTreeSplit::SetRowColFooterPicture(LPCSFT_PICTURE lpPicture); ``` ### Parameters hwndCtl The window handle of the tree control. lpPicture A pointer to a [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) structure to be used as row/column footer picture. If the SFT_PICTURE structure defines a bitmap handle, the top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL to remove the row/column footer picture. ### Returns Get/SetRowColFooterPicture returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetRowColFooterPicture and SetRowColFooterPicture functions define the picture displayed in the row/column footer. Get/SetRowColFooterPicture can be used to define a row/column footer picture using a bitmap, icon or ImageList image. The dimensions of the picture are used to calculate the minimum dimension for the [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers), [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) and row/column footers, so pictures displayed in row headers, column footers and row/column footers are never clipped vertically. The horizontal and vertical alignment of the row/column picture is defined using [RowColFooterPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterpicturestyle). The row/column footer area is only shown if row headers and column footers are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColFooterPictureStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterpicturestyle* Defines the position of the picture displayed in the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer). C ``` DWORD WINAPI SftTree_GetRowColFooterPictureStyle(HWND hwndCtl); void WINAPI SftTree_SetRowColFooterPictureStyle(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetRowColFooterPictureStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColFooterPictureStyle(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetRowColFooterPictureStyle() const; void CSftTree::SetRowColFooterPictureStyle(DWORD style); DWORD CSftTreeSplit::GetRowColFooterPictureStyle() const; void CSftTreeSplit::SetRowColFooterPictureStyle(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style The picture location relative to the row/column footer text. One value of each of the following tables can be combined and passed as *style* parameter. | style | Horizontal row/column footer picture alignment | | --- | --- | | SFTTREE_BMP_LEFT | The row/column footer picture is displayed to the left of the footer text. If no horizontal row/column footer picture alignment value is specified, SFTTREE_BMP_LEFT is assumed. | | SFTTREE_BMP_CENTER | The row/column footer picture is displayed in the center of the row/column footer, the row/column footer text is not shown. | | SFTTREE_BMP_RIGHT | The row/column footer picture is displayed to the right of the row/column footer text. | | style | Vertical row/column footer picture alignment | | --- | --- | | SFTTREE_BMP_VCENTER | The row/column footer picture is vertically centered within the row/column footer. If no vertical row/column footer alignment value is specified, SFTTREE_BMP_VCENTER is assumed. | | SFTTREE_BMP_TOP | The row/column footer picture is vertically aligned with the top of the row/column footer. | | SFTTREE_BMP_BOTTOM | The row/column footer picture is vertically aligned with the bottom of the row/column footer. | ### Returns GetRowColFooterPictureStyle returns a value indicating the position of the picture displayed in the row/column footer. ### Comments The GetRowColFooterPictureStyle and SetRowColFooterPictureStyle functions define the position of the picture displayed in the row/column footer. The row/column footer area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColFooterRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterrect* Returns the dimensions of the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) area. C ``` void WINAPI SftTree_GetRowColFooterRect(HWND hwndCtl, LPRECT lpRect); void WINAPI SftTreeSplit_GetRowColFooterRect(HWND hwndCtl, LPRECT lpRect); ``` C++ ``` void CSftTree::GetRowColFooterRect(LPRECT lpRect) const; void CSftTreeSplit::GetRowColFooterRect(LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. lpRect Address of a RECT structure, where the coordinates will be returned. ### Returns The returned RECT structure describes the location of the row/column footer area. ### Comments The GetRowColFooterRect function returns the dimensions of the row/column footer area. An empty rectangle is returned if the row/column footer is not shown. The row/column footer area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColFooterStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfooterstyle* Defines the position of the text displayed in the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer). C ``` DWORD WINAPI SftTree_GetRowColFooterStyle(HWND hwndCtl); void WINAPI SftTree_SetRowColFooterStyle(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetRowColFooterStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColFooterStyle(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetRowColFooterStyle() const; void CSftTree::SetRowColFooterStyle(DWORD style); DWORD CSftTreeSplit::GetRowColFooterStyle() const; void CSftTreeSplit::SetRowColFooterStyle(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style The style used for the row/column footer. One value of each of the following tables can be combined and passed as *style* parameter. | style | Horizontal row/column footer text alignment | | --- | --- | | *not specified* | If no horizontal row/column footer text alignment is specified, the default is ES_LEFT. | | ES_LEFT | The row/column footer text is left aligned within the row/column footer. | | ES_CENTER | The row/column footer text is centered within the row/column footer. | | ES_RIGHT | The row/column footer text is right aligned within the row/column footer. | | style | Vertical row/column footer text alignment | | --- | --- | | *not specified* | If no vertical row/column footer text alignment is specified, the default is SFTTREE_VCENTER. | | SFTTREE_TOP | The row/column footer text and picture are aligned with the top of the row/column footer. | | SFTTREE_VCENTER | The row/column footer text and picture are vertically centered within the row/column footer. | | SFTTREE_BOTTOM | The row/column footer text and picture are aligned with the bottom of the row/column footer. | The *style* value can optionally be combined with one or more of the following values: | | | | --- | --- | | SFTTREE_HEADER_DISABLED | The row/column footer is disabled, cannot be clicked and is displayed in a "grayed" fashion. | | SFTTREE_HEADER_UP | The row/column footer buttons will automatically return to its "up" position when clicked. | ### Returns GetRowColFooterStyle returns a value indicating the position of the text displayed in the row/column footer. ### Comments The GetRowColFooterStyle and SetRowColFooterStyle functions define the position of the text displayed in the row/column footer. The row/column footer text can be defined using [SetRowColFooterText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfootertext). The row/column footer area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColFooterText *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfootertext* Defines the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) text. C ``` int SftTree_GetRowColFooterText(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetRowColFooterText_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetRowColFooterText_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); BOOL SftTree_SetRowColFooterText(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTree_SetRowColFooterText_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTree_SetRowColFooterText_W(HWND hwndCtl, LPCWSTR lpszText); int WINAPI SftTreeSplit_GetRowColFooterText(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetRowColFooterText_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetRowColFooterText_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); BOOL WINAPI SftTreeSplit_SetRowColFooterText(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTreeSplit_SetRowColFooterText_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTreeSplit_SetRowColFooterText_W(HWND hwndCtl, LPCWSTR lpszText); ``` C++ ``` void CSftTree::GetRowColFooterText(CString& string) const; int CSftTree::GetRowColFooterText(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTree::SetRowColFooterText(LPCTSTR lpszText); void CSftTreeSplit::GetRowColFooterText(CString& string) const; int CSftTreeSplit::GetRowColFooterText(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTreeSplit::SetRowColFooterText(LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. lpszBuffer A pointer to a buffer where the row/column footer text will be returned (GetRowColFooterText) or a buffer containing the new row/column footer text (SetRowColFooterText). string A reference to a CString object, where the row/column footer text will be returned. cbMax The maximum number of characters to be returned in the buffer pointed to by *lpszBuffer*, including the terminating '\0'. ### Returns GetRowColFooterText returns the number of characters returned in the buffer, not including the terminating '\0'. If the buffer is too small to receive the complete header text, the text is truncated. -1 is returned if an error occurred. SetRowColFooterText returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetRowColFooterText and SetRowColFooterText functions define the row/column footer text. [GetRowColFooterTextLen](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfootertextlength) can be used to determine the required *lpszBuffer* size. Row/column footer text may contain multiple lines of text, delimited using cr-lf (\r\n), based on the settings defined using [MultilineFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilinefooter) and it must contain the same or fewer lines of text as defined for all [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers). The row/column footer area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and column footers are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColFooterTextLength *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolfootertextlength* Returns the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) text length. C ``` int WINAPI SftTree_GetRowColFooterTextLength(HWND hwndCtl); int WINAPI SftTreeSplit_GetRowColFooterTextLength(HWND hwndCtl); ``` C++ ``` int CSftTree::GetRowColFooterTextLen() const; int CSftTreeSplit::GetRowColFooterTextLen() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the length of the row/column footer text in characters, not including the terminating '\0' or -1 if an error occurred. ### Comments The GetRowColFooterTextLength function returns the row/column footer text length. The row/column footer area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColHeaderButton *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderbutton* Defines whether the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) button is currently down (pressed). C ``` BOOL WINAPI SftTree_GetRowColHeaderButton(HWND hwndCtl); void WINAPI SftTree_SetRowColHeaderButton(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetRowColHeaderButton(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColHeaderButton(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetRowColHeaderButton() const; void CSftTree::SetRowColHeaderButton(BOOL fSet); BOOL CSftTreeSplit::GetRowColHeaderButton() const; void CSftTreeSplit::SetRowColHeaderButton(BOOL fSet); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display the row/column header button is in its "down" position, set to FALSE to display it in its "up", unpressed state. ### Returns GetRowColHeaderButton returns TRUE if the row/column header button is in its "down" position, otherwise FALSE is returned. ### Comments The GetRowColHeaderButton and SetRowColHeaderButton functions define whether the row/column header button is currently down (pressed). This function can only be used if the row/column header is displayed as a button (see [SetShowRowColHeaderButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowcolheaderbutton)). The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColHeaderPicture *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicture* Defines the picture displayed in the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). C ``` BOOL WINAPI SftTree_GetRowColHeaderPicture(HWND hwndCtl, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTree_SetRowColHeaderPicture(HWND hwndCtl, LPCSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_GetRowColHeaderPicture(HWND hwndCtl, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_SetRowColHeaderPicture(HWND hwndCtl, LPCSFT_PICTURE lpPicture); ``` C++ ``` BOOL CSftTree::GetRowColHeaderPicture(LPSFT_PICTURE lpPicture) const; BOOL CSftTree::SetRowColHeaderPicture(LPCSFT_PICTURE lpPicture); BOOL CSftTreeSplit::GetRowColHeaderPicture(LPSFT_PICTURE lpPicture) const; BOOL CSftTreeSplit::SetRowColHeaderPicture(LPCSFT_PICTURE lpPicture); ``` ### Parameters hwndCtl The window handle of the tree control. lpPicture A pointer to a [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) structure to be used as row/column header picture. If the SFT_PICTURE structure defines a bitmap handle, the top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL to remove the row/column header picture. ### Returns Get/SetRowColHeaderPicture returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetRowColHeaderPicture and SetRowColHeaderPicture functions define the picture displayed in the row/column header. Get/SetRowColHeaderPicture can be used to define a row/column header picture using a bitmap, icon or ImageList image. The dimensions of the picture are used to calculate the minimum dimension for the [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers), [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) and row/column headers, so pictures displayed in row headers, column headers and row/column headers are never clipped vertically. The horizontal and vertical alignment of the row/column picture is defined using [RowColHeaderPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicturestyle). The row/column header area is only shown if row headers and column headers are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColHeaderPictureStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicturestyle* Defines the position of the picture displayed in the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). C ``` DWORD WINAPI SftTree_GetRowColHeaderPictureStyle(HWND hwndCtl); void WINAPI SftTree_SetRowColHeaderPictureStyle(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetRowColHeaderPictureStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColHeaderPictureStyle(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetRowColHeaderPictureStyle() const; void CSftTree::SetRowColHeaderPictureStyle(DWORD style); DWORD CSftTreeSplit::GetRowColHeaderPictureStyle() const; void CSftTreeSplit::SetRowColHeaderPictureStyle(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style The picture location relative to the row/column header text. One value of each of the following tables can be combined and passed as *style* parameter. | style | Horizontal row/column header picture alignment | | --- | --- | | SFTTREE_BMP_LEFT | The row/column header picture is displayed to the left of the header text. If no horizontal row/column header picture alignment value is specified, SFTTREE_BMP_LEFT is assumed. | | SFTTREE_BMP_CENTER | The row/column header picture is displayed in the center of the row/column header, the row/column header text is not shown. | | SFTTREE_BMP_RIGHT | The row/column header picture is displayed to the right of the row/column header text. | | style | Vertical row/column header picture alignment | | --- | --- | | SFTTREE_BMP_VCENTER | The row/column header picture is vertically centered within the row/column header. If no vertical row/column header alignment value is specified, SFTTREE_BMP_VCENTER is assumed. | | SFTTREE_BMP_TOP | The row/column header picture is vertically aligned with the top of the row/column header. | | SFTTREE_BMP_BOTTOM | The row/column header picture is vertically aligned with the bottom of the row/column header. | ### Returns GetRowColHeaderPictureStyle returns a value indicating the position of the picture displayed in the row/column header. ### Comments The GetRowColHeaderPictureStyle and SetRowColHeaderPictureStyle functions define the position of the picture displayed in the row/column header. The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). Get/[SetRowColBitmapStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmapstyle) and Get/[SetRowColPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolpicturestyle) are synonyms for Get/SetRowColHeaderPictureStyle. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColHeaderRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderrect* Returns the dimensions of the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) area. C ``` void WINAPI SftTree_GetRowColHeaderRect(HWND hwndCtl, LPRECT lpRect); void WINAPI SftTreeSplit_GetRowColHeaderRect(HWND hwndCtl, LPRECT lpRect); ``` C++ ``` void CSftTree::GetRowColHeaderRect(LPRECT lpRect) const; void CSftTreeSplit::GetRowColHeaderRect(LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. lpRect Address of a RECT structure, where the coordinates will be returned. ### Returns The returned RECT structure describes the location of the row/column header area. ### Comments The GetRowColHeaderRect function returns the dimensions of the row/column header area. An empty rectangle is returned if the row/column header is not shown. The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColHeaderStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderstyle* Defines the position of the text displayed in the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). C ``` DWORD WINAPI SftTree_GetRowColHeaderStyle(HWND hwndCtl); void WINAPI SftTree_SetRowColHeaderStyle(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetRowColHeaderStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColHeaderStyle(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetRowColHeaderStyle() const; void CSftTree::SetRowColHeaderStyle(DWORD style); DWORD CSftTreeSplit::GetRowColHeaderStyle() const; void CSftTreeSplit::SetRowColHeaderStyle(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style The style used for the row/column header. One value of each of the following tables can be combined and passed as *style* parameter. | style | Horizontal row/column header text alignment | | --- | --- | | *not specified* | If no horizontal row/column header text alignment is specified, the default is ES_LEFT. | | ES_LEFT | The row/column header text is left aligned within the row/column header. | | ES_CENTER | The row/column header text is centered within the row/column header. | | ES_RIGHT | The row/column header text is right aligned within the row/column header. | | style | Vertical row/column header text alignment | | --- | --- | | *not specified* | If no vertical row/column header text alignment is specified, the default is SFTTREE_VCENTER. | | SFTTREE_TOP | The row/column header text and picture are aligned with the top of the row/column header. | | SFTTREE_VCENTER | The row/column header text and picture are vertically centered within the row/column header. | | SFTTREE_BOTTOM | The row/column header text and picture are aligned with the bottom of the row/column header. | The *style* value can optionally be combined with one or more of the following values: | | | | --- | --- | | SFTTREE_HEADER_DISABLED | The row/column header is disabled, cannot be clicked and is displayed in a "grayed" fashion. | | SFTTREE_HEADER_UP | The row/column header buttons will automatically return to its "up" position when clicked. | ### Returns GetRowColHeaderStyle returns a value indicating the position of the text displayed in the row/column header. ### Comments The GetRowColHeaderStyle and SetRowColHeaderStyle functions define the position of the text displayed in the row/column header. The row/column header text can be defined using [SetRowColHeaderText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertext). The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColHeaderText *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertext* Defines the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) text. C ``` int SftTree_GetRowColHeaderText(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetRowColHeaderText_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetRowColHeaderText_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); BOOL SftTree_SetRowColHeaderText(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTree_SetRowColHeaderText_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTree_SetRowColHeaderText_W(HWND hwndCtl, LPCWSTR lpszText); int WINAPI SftTreeSplit_GetRowColHeaderText(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetRowColHeaderText_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetRowColHeaderText_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); BOOL WINAPI SftTreeSplit_SetRowColHeaderText(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTreeSplit_SetRowColHeaderText_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTreeSplit_SetRowColHeaderText_W(HWND hwndCtl, LPCWSTR lpszText); ``` C++ ``` void CSftTree::GetRowColHeaderText(CString& string) const; int CSftTree::GetRowColHeaderText(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTree::SetRowColHeaderText(LPCTSTR lpszText); void CSftTreeSplit::GetRowColHeaderText(CString& string) const; int CSftTreeSplit::GetRowColHeaderText(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTreeSplit::SetRowColHeaderText(LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. lpszBuffer A pointer to a buffer where the row/column header text will be returned (GetRowColHeaderText) or a buffer containing the new row/column header text (SetRowColHeaderText). string A reference to a CString object, where the row/column header text will be returned. cbMax The maximum number of characters to be returned in the buffer pointed to by *lpszBuffer*, including the terminating '\0'. ### Returns GetRowColHeaderText returns the number of characters returned in the buffer, not including the terminating '\0'. If the buffer is too small to receive the complete header text, the text is truncated. -1 is returned if an error occurred. SetRowColHeaderText returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetRowColHeaderText and SetRowColHeaderText functions define the row/column header text. [GetRowColHeaderTextLen](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertextlength) can be used to determine the required *lpszBuffer* size. Row/column header text may contain multiple lines of text, delimited using cr-lf (\r\n), based on the settings defined using [MultilineHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilineheader) and it must contain the same or fewer lines of text as defined for all [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers). The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and column headers are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). Get/[RowColText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcoltext) is a synonym for Get/SetRowColHeaderText. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColHeaderTextLength *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertextlength* Returns the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) text length. C ``` int WINAPI SftTree_GetRowColHeaderTextLength(HWND hwndCtl); int WINAPI SftTreeSplit_GetRowColHeaderTextLength(HWND hwndCtl); ``` C++ ``` int CSftTree::GetRowColHeaderTextLen() const; int CSftTreeSplit::GetRowColHeaderTextLen() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the length of the row/column header text in characters, not including the terminating '\0' or -1 if an error occurred. ### Comments The GetRowColHeaderTextLength function returns the row/column header text length. The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColPicture *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolpicture* Defines the picture displayed in the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). > These functions are provided for compatibility with older releases - use [RowColHeaderPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicture) instead C ``` BOOL WINAPI SftTree_GetRowColPicture(HWND hwndCtl, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTree_SetRowColPicture(HWND hwndCtl, LPCSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_GetRowColPicture(HWND hwndCtl, LPSFT_PICTURE lpPicture); BOOL WINAPI SftTreeSplit_SetRowColPicture(HWND hwndCtl, LPCSFT_PICTURE lpPicture); ``` C++ ``` BOOL CSftTree::GetRowColPicture(LPSFT_PICTURE lpPicture) const; BOOL CSftTree::SetRowColPicture(LPCSFT_PICTURE lpPicture); BOOL CSftTreeSplit::GetRowColPicture(LPSFT_PICTURE lpPicture) const; BOOL CSftTreeSplit::SetRowColPicture(LPCSFT_PICTURE lpPicture); ``` ### Parameters hwndCtl The window handle of the tree control. lpPicture A pointer to a [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) structure to be used as row/column header picture. If the SFT_PICTURE structure defines a bitmap handle, the top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL to remove the row/column header picture. ### Returns Get/SetRowColPicture returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments > These functions are provided for compatibility with older releases - use RowColHeaderPicture instead The GetRowColPicture and SetRowColPicture functions define the picture displayed in the row/column header. Get/SetRowColPicture can be used to define a row/column header picture using a bitmap, icon or ImageList image. Get/[SetRowColBitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmap) can be used to define a row/column header picture using a bitmap handle only. The dimensions of the picture are used to calculate the minimum dimension for the [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers), [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) and row/column headers, so pictures displayed in row headers, column headers and row/column headers are never clipped vertically. The horizontal and vertical alignment of the row/column picture is defined using [RowColHeaderPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicturestyle). The row/column header area is only shown if row headers and column headers are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColPictureStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolpicturestyle* Defines the position of the picture displayed in the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header). > These functions are provided for compatibility with older releases - use [RowColHeaderPictureStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheaderpicturestyle) instead C ``` DWORD WINAPI SftTree_GetRowColPictureStyle(HWND hwndCtl); void WINAPI SftTree_SetRowColPictureStyle(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetRowColPictureStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowColPictureStyle(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetRowColPictureStyle() const; void CSftTree::SetRowColPictureStyle(DWORD style); DWORD CSftTreeSplit::GetRowColPictureStyle() const; void CSftTreeSplit::SetRowColPictureStyle(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style The picture location relative to the row/column header text. One value of each of the following tables can be combined and passed as *style* parameter. | style | Horizontal row/column header picture alignment | | --- | --- | | SFTTREE_BMP_LEFT | The row/column header picture is displayed to the left of the header text. If no horizontal row/column header picture alignment value is specified, SFTTREE_BMP_LEFT is assumed. | | SFTTREE_BMP_CENTER | The row/column header picture is displayed in the center of the row/column header, the row/column header text is not shown. | | SFTTREE_BMP_RIGHT | The row/column header picture is displayed to the right of the row/column header text. | | style | Vertical row/column header picture alignment | | --- | --- | | SFTTREE_BMP_VCENTER | The row/column header picture is vertically centered within the row/column header. If no vertical row/column header alignment value is specified, SFTTREE_BMP_VCENTER is assumed. | | SFTTREE_BMP_TOP | The row/column header picture is vertically aligned with the top of the row/column header. | | SFTTREE_BMP_BOTTOM | The row/column header picture is vertically aligned with the bottom of the row/column header. | ### Returns GetRowColPictureStyle returns a value indicating the position of the picture displayed in the row/column header. ### Comments > These functions are provided for compatibility with older releases - use RowColHeaderPictureStyle instead The GetRowColPictureStyle and SetRowColPictureStyle functions define the position of the picture displayed in the row/column header. The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). Get/[SetRowColBitmapStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolbitmapstyle) is a synonym for Get/SetRowColPictureStyle. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColText *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcoltext* Defines the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) text. > These functions are provided for compatibility with older releases - use [RowColHeaderText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertext) instead C ``` int SftTree_GetRowColText(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetRowColText_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); int WINAPI SftTree_GetRowColText_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); BOOL SftTree_SetRowColText(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTree_SetRowColText_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTree_SetRowColText_W(HWND hwndCtl, LPCWSTR lpszText); int WINAPI SftTreeSplit_GetRowColText(HWND hwndCtl, LPTSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetRowColText_A(HWND hwndCtl, LPSTR lpszBuffer, int cbMax); int WINAPI SftTreeSplit_GetRowColText_W(HWND hwndCtl, LPWSTR lpszBuffer, int cbMax); BOOL WINAPI SftTreeSplit_SetRowColText(HWND hwndCtl, LPCTSTR lpszText); BOOL WINAPI SftTreeSplit_SetRowColText_A(HWND hwndCtl, LPCSTR lpszText); BOOL WINAPI SftTreeSplit_SetRowColText_W(HWND hwndCtl, LPCWSTR lpszText); ``` C++ ``` void CSftTree::GetRowColText(CString& string) const; int CSftTree::GetRowColText(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTree::SetRowColText(LPCTSTR lpszText); void CSftTreeSplit::GetRowColText(CString& string) const; int CSftTreeSplit::GetRowColText(LPTSTR lpszBuffer, int cbMax) const; BOOL CSftTreeSplit::SetRowColText(LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. lpszBuffer A pointer to a buffer where the row/column header text will be returned (GetRowColText) or a buffer containing the new row/column header text (SetRowColText). string A reference to a CString object, where the row/column header text will be returned. cbMax The maximum number of characters to be returned in the buffer pointed to by *lpszBuffer*, including the terminating '\0'. ### Returns GetRowColText returns the number of characters returned in the buffer, not including the terminating '\0'. If the buffer is too small to receive the complete header text, the text is truncated. -1 is returned if an error occurred. SetRowColText returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments > These functions are provided for compatibility with older releases - use RowColHeaderText instead The GetRowColText and SetRowColText functions define the row/column header text. [RowColHeaderTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertextlength) can be used to determine the required *lpszBuffer* size. Row/column header text may contain multiple lines of text, delimited using cr-lf (\r\n), based on the settings defined using [MultilineHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilineheader) and it must contain the same or fewer lines of text as defined for all [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers). The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and column headers are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowColTextLength *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcoltextlength* Returns the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) text length. > These functions are provided for compatibility with older releases - use [RowColHeaderTextLength](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowcolheadertextlength) instead C ``` int WINAPI SftTree_GetRowColTextLength(HWND hwndCtl); int WINAPI SftTreeSplit_GetRowColTextLength(HWND hwndCtl); ``` C++ ``` int CSftTree::GetRowColTextLen() const; int CSftTreeSplit::GetRowColTextLen() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the length of the row/column header text in characters, not including the terminating '\0' or -1 if an error occurred. ### Comments > These functions are provided for compatibility with older releases - use RowColHeaderTextLength instead The GetRowColTextLength function returns the row/column header text length. The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowHeaderFont *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderfont* Defines the font used for [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) text display. C ``` HFONT WINAPI SftTree_GetRowHeaderFont(HWND hwndCtl); void WINAPI SftTree_SetRowHeaderFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw); HFONT WINAPI SftTreeSplit_GetRowHeaderFont(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowHeaderFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw); ``` C++ ``` CFont* CSftTree::GetRowHeaderFont() const; void CSftTree::SetRowHeaderFont(CFont* pFont, BOOL fRedraw = TRUE); CFont* CSftTreeSplit::GetRowHeaderFont() const; void CSftTreeSplit::SetRowHeaderFont(CFont* pFont, BOOL fRedraw = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. hfont The font handle describing the new font to be used to draw the row header text. pFont A pointer to a CFont object describing the new font to be used to draw the row header text. fRedraw Set to TRUE to cause the tree control to be repainted immediately, otherwise set to FALSE. ### Returns GetRowHeaderFont returns the font used to draw the row header text. ### Comments The GetRowHeaderFont and SetRowHeaderFont functions define the font used for row header text display. The [default font](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_font) used is the system font (GetStockObject(DEFAULT_GUI_FONT)). The application retains ownership of the font and cannot delete the font until the tree control no longer uses the font (usually until the tree control is destroyed or the font is changed using SetRowHeaderFont). To change the font used for item text, use the WM_SETFONT message (CWnd::SetFont). The WM_SETFONT message overrides the font defined using SetRowHeaderFont. If the row header font needs to be changed, it must be changed after using the WM_SETFONT message. The CFont* pointer returned by GetRowHeaderFont may point to a temporary object and should not be stored for later use. Row headers are made visible using [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowHeaderLines *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderlines* Defines the number of text lines used for [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) height calculation. C ``` int WINAPI SftTree_GetRowHeaderLines(HWND hwndCtl); void WINAPI SftTree_SetRowHeaderLines(HWND hwndCtl, int nLines); int WINAPI SftTreeSplit_GetRowHeaderLines(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowHeaderLines(HWND hwndCtl, int nLines); ``` C++ ``` int CSftTree::GetRowHeaderLines() const; void CSftTree::SetRowHeaderLines(int nLines = 1); int CSftTreeSplit::GetRowHeaderLines() const; void CSftTreeSplit::SetRowHeaderLines(int nLines = 1); ``` ### Parameters hwndCtl The window handle of the tree control. nLines The number of text lines used for row headers to calculate the expected height of items. ### Returns GetRowHeaderLines returns the current number of text lines last defined using SetRowHeaderLines. ### Comments The GetRowHeaderLines and SetRowHeaderLines functions define the number of text lines used for row header height calculation. The height of items is determined based on an item's attributes such as registered [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap) size, [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap) size, fonts used, etc. Using SetRowHeaderLines, an application can specify how many lines of text an item can display in a row header. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control (see [SFTTREESTYLE_VARIABLE](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles)), all row headers have the same number of text lines. If an application needs [multiple text lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_multiline_cell_text), SetRowHeaderLines must be used to specify the number of text lines. In a variable height tree control, each item's height is determined individually. If an application requires new line characters in row headers, SetRowHeaderLines must be used to specify the maximum number of text lines to display in all row headers. If row header text exceeds the specified number of lines, "+" is shown at the bottom, right corner of the row header. A tree control defaults to one line of text for each row header. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowHeaderRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderrect* Returns the dimensions of the [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) area. C ``` void WINAPI SftTree_GetRowHeaderRect(HWND hwndCtl, int index, LPRECT lpRect); void WINAPI SftTreeSplit_GetRowHeaderRect(HWND hwndCtl, int index, LPRECT lpRect); ``` C++ ``` void CSftTree::GetRowHeaderRect(int index, LPRECT lpRect) const; void CSftTreeSplit::GetRowHeaderRect(int index, LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the row header location is to be retrieved. lpRect A pointer to a RECT structure where the location of the requested row header is returned. ### Comments The GetRowHeaderRect function returns the dimensions of the row header area. An empty rectangle is returned if an invalid item number is specified or row headers are not shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader)). The coordinates returned in *lpRect* are coordinates relative to the tree control's client area (in pixels). Row headers are made visible using SetShowRowHeader. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowHeaderStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderstyle* Defines the position of text displayed in the [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers). C ``` DWORD WINAPI SftTree_GetRowHeaderStyle(HWND hwndCtl); void WINAPI SftTree_SetRowHeaderStyle(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetRowHeaderStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowHeaderStyle(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetRowHeaderStyle() const; void CSftTree::SetRowHeaderStyle(DWORD style); DWORD CSftTreeSplit::GetRowHeaderStyle() const; void CSftTreeSplit::SetRowHeaderStyle(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style The row header style used for all row headers. This value applies to all row headers. One value of each of the following tables can be combined and passed as *style* parameter. | style | Horizontal row header text alignment | | --- | --- | | *not specified* | If no horizontal row header text alignment is specified, the default is ES_LEFT. | | ES_LEFT | The row header text is left aligned within the row header. Row headers can override this default by defining new alignment values using the [SFTTREE_ROW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_row), *flag* member. | | ES_CENTER | The row header text is centered within the row header. Row headers can override this default by defining new alignment values using the SFTTREE_ROW, *flag* member. | | ES_RIGHT | The row header text is right aligned within the row header. Row headers can override this default by defining new alignment values using the SFTTREE_ROW, *flag* member. | | style | Vertical row header text alignment | | --- | --- | | *not specified* | If no vertical row header text alignment is specified, the default is SFTTREE_VCENTER. | | SFTTREE_TOP | The row header text and picture are aligned with the top of the row header. Row headers can override this default by defining new alignment values using the SFTTREE_ROW, *flag* member. | | SFTTREE_VCENTER | The row header text and picture are vertically centered within the row header. Row headers can override this default by defining new alignment values using the SFTTREE_ROW, *flag* member. | | SFTTREE_BOTTOM | The row header text and picture are aligned with the bottom of the row header. Row headers can override this default by defining new alignment values using the SFTTREE_ROW, *flag* member. | The *style* value can optionally be combined with one or more of the following values: | | | | --- | --- | | SFTTREE_HEADER_DISABLED | The row headers are disabled, cannot be clicked and are displayed in a "grayed" fashion. The item contents are otherwise unaffected. | | SFTTREE_HEADER_UP | The row header buttons will automatically return to their "up" position when clicked. | ### Returns GetRowHeaderStyle returns a value indicating the position of the text displayed in row headers. ### Comments The GetRowHeaderStyle and SetRowHeaderStyle functions define the position of text displayed in the row headers. The row header style defined using SetRowHeaderStyle affects all row headers, individual items cannot override the style given. Row header text can be defined using [SetRowText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtext). Row headers are made visible using [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowHeaderWidth *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderwidth* Defines the width of the [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) area. C ``` int WINAPI SftTree_GetRowHeaderWidth(HWND hwndCtl); void WINAPI SftTree_SetRowHeaderWidth(HWND hwndCtl, int width); int WINAPI SftTreeSplit_GetRowHeaderWidth(HWND hwndCtl); void WINAPI SftTreeSplit_SetRowHeaderWidth(HWND hwndCtl, int width); ``` C++ ``` int CSftTree::GetRowHeaderWidth() const; void CSftTree::SetRowHeaderWidth(int width); int CSftTreeSplit::GetRowHeaderWidth() const; void CSftTreeSplit::SetRowHeaderWidth(int width); ``` ### Parameters hwndCtl The window handle of the tree control. width The new row header area width in pixels. ### Returns GetRowHeaderWidth returns the current width (in pixels) of the row header area. ### Comments The GetRowHeaderWidth and SetRowHeaderWidth functions define the width of the row header area. [CalcOptimalRowHeaderWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalrowheaderwidth) or [MakeRowHeaderOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makerowheaderoptimal) can be used to calculate or define the optimal width for the row (and row/column) header area. An optimal width allows all text and bitmaps in the row headers to be displayed in their entirety, without being clipped. Row headers are made visible using [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowInfo *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowinfo* Defines an item's [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) attributes. C ``` BOOL WINAPI SftTree_GetRowInfo(HWND hwndCtl, LPSFTTREE_ROWINFOPARM lpRowParm); BOOL WINAPI SftTree_SetRowInfo(HWND hwndCtl, LPCSFTTREE_ROWINFOPARM lpRowParm); BOOL WINAPI SftTreeSplit_GetRowInfo(HWND hwndCtl, LPSFTTREE_ROWINFOPARM lpRowParm); BOOL WINAPI SftTreeSplit_SetRowInfo(HWND hwndCtl, LPCSFTTREE_ROWINFOPARM lpRowParm); ``` C++ ``` BOOL CSftTree::GetRowInfo(LPSFTTREE_ROWINFOPARM lpRowParm) const; BOOL CSftTree::SetRowInfo(LPCSFTTREE_ROWINFOPARM lpRowParm); BOOL CSftTreeSplit::GetRowInfo(LPSFTTREE_ROWINFOPARM lpRowParm) const; BOOL CSftTreeSplit::SetRowInfo(LPCSFTTREE_ROWINFOPARM lpRowParm); ``` ### Parameters hwndCtl The window handle of the tree control. lpRowParm A pointer to a [SFTTREE_ROWINFOPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_rowinfoparm) structure where row information is to be retrieved (GetRowInfo) or new row information for the specified item (SetRowInfo). ### Returns The return value is TRUE if the function is successful, FALSE if an error occurred. ### Comments The GetRowInfo and SetRowInfo functions define an item's row header attributes. To modify a row header's attributes, the GetRowInfo function is used to retrieve its current attributes. The [SFTTREE_ROW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_row) structure, part of the SFTTREE_ROWINFOPARM structure, can then be modified, setting the desired attributes. Finally, the row header is updated by a call to the SetRowInfo function. Row header text can be retrieved using [GetRowText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtext) and modified using SetRowText. Row headers are made visible using [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif) In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetRowInfo can only be used to register a row header picture size. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowText *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtext* Defines an item's [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) text. C ``` int SftTree_GetRowText(HWND hwndCtl, int index, LPTSTR lpszBuffer); int WINAPI SftTree_GetRowText_A(HWND hwndCtl, int index, LPSTR lpszBuffer); int WINAPI SftTree_GetRowText_W(HWND hwndCtl, int index, LPWSTR lpszBuffer); BOOL SftTree_SetRowText(HWND hwndCtl, int index, LPCTSTR lpszText); BOOL WINAPI SftTree_SetRowText_A(HWND hwndCtl, int index, LPCSTR lpszText); BOOL WINAPI SftTree_SetRowText_W(HWND hwndCtl, int index, LPCWSTR lpszText); int SftTreeSplit_GetRowText(HWND hwndCtl, int index, LPTSTR lpszBuffer); int WINAPI SftTreeSplit_GetRowText_A(HWND hwndCtl, int index, LPSTR lpszBuffer); int WINAPI SftTreeSplit_GetRowText_W(HWND hwndCtl, int index, LPWSTR lpszBuffer); BOOL SftTreeSplit_SetRowText(HWND hwndCtl, int index, LPCTSTR lpszText); BOOL WINAPI SftTreeSplit_SetRowText_A(HWND hwndCtl, int index, LPCSTR lpszText); BOOL WINAPI SftTreeSplit_SetRowText_W(HWND hwndCtl, int index, LPCWSTR lpszText); ``` C++ ``` void CSftTree::GetRowText(int index, CString& string) const; int CSftTree::GetRowText(int index, LPTSTR lpszBuffer) const; BOOL CSftTree::SetRowText(int index, LPCTSTR lpszText); void CSftTreeSplit::GetRowText(int index, CString& string) const; int CSftTreeSplit::GetRowText(int index, LPTSTR lpszBuffer) const; BOOL CSftTreeSplit::SetRowText(int index, LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the row header text is to be retrieved or set. lpszBuffer A pointer to a buffer where the row header text will be returned (GetRowText) or a buffer containing the new row header text (SetRowText). string A reference to a CString object, where the row header text will be returned. ### Returns GetRowText returns the number of characters returned in the buffer, not including the terminating '\0'. SetRowText returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetRowText and SetRowText functions define an item's row header text. [GetRowTextLen](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtextlength) can be used to determine the required * lpszBuffer* size. Row header text may contain multiple lines of text, delimited using cr-lf (\r\n) based on the settings defined using [SetRowHeaderLines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderlines). Row headers are made visible using [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetRowText cannot be used and an error is returned. The *lpRow* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RowTextLength *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtextlength* Returns an item's [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) text length. C ``` int WINAPI SftTree_GetRowTextLength(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetRowTextLength(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetRowTextLen(int index) const; int CSftTreeSplit::GetRowTextLen(int index) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the row header text length is to be retrieved. ### Returns The return value is the length of the specified item's row header text in characters, not including the terminating '\0' or -1 if an error occurred. ### Comments The GetRowTextLength function returns an item's row header text length. Row headers are made visible using [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## RubberbandSelection *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rubberbandselection* Defines whether click-drag selection of multiple items using a selection rectangle is supported. C ``` BOOL WINAPI SftTree_GetRubberbandSelection(HWND hwndCtl); void WINAPI SftTree_SetRubberbandSelection(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetRubberbandSelection(HWND hwndCtl); void WINAPI SftTreeSplit_SetRubberbandSelection(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetRubberbandSelection() const; void CSftTree::SetRubberbandSelection(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetRubberbandSelection() const; void CSftTreeSplit::SetRubberbandSelection(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to enable click-drag selection of multiple items using a selection rectangle, FALSE otherwise. ### Returns GetRubberbandSelection returns TRUE if click-drag selection of multiple items using a selection rectangle is enabled. Otherwise, FALSE is returned. ### Comments The GetRubberbandSelection and SetRubberbandSelection functions define whether click-drag selection of multiple items using a selection rectangle is supported. > In a [single selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) this property has no effect. Click-drag selection is only available in a multiple selection tree control and only if [SelectionStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle) is set to SFTTREE_SELECTION_CELL1FULL, SFTTREE_SELECTION_CELL1 or SFTTREE_SELECTION_CELLCURRENT. If SelectionStyle is set to SFTTREE_SELECTION_CELLCURRENT, click-dragging cannot start in the first column, it must be initiated from another column. Click-drag selection with a "rubberband" selection rectangle can be initiated by pressing the mouse button on the [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) background (not the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text)) of a cell and dragging the mouse cursor. All items between the starting and ending point are selected. If the mouse cursor approaches the edge of the tree control, scrolling will start, allowing selection of additional items. Once the mouse button is released, the currently selected items remain selected. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ScrollTips *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_scrolltips* Defines whether ScrollTips are displayed during vertical scrolling. C ``` BOOL WINAPI SftTree_GetScrollTips(HWND hwndCtl); void WINAPI SftTree_SetScrollTips(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetScrollTips(HWND hwndCtl); void WINAPI SftTreeSplit_SetScrollTips(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetScrollTips() const; void CSftTree::SetScrollTips(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetScrollTips() const; void CSftTreeSplit::SetScrollTips(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display ScrollTips during vertical scrolling, otherwise set to FALSE. ### Returns GetScrollTips returns a value indicating whether ScrollTips are displayed during vertical scrolling. TRUE is returned if ScrollTips are shown, otherwise FALSE is returned. ### Comments The GetScrollTips and SetScrollTips functions define whether ScrollTips are displayed during vertical scrolling. If enabled, ScrollTips are displayed when the user drags the vertical scroll bar's scroll box using the mouse. By default, the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) of the first displayed item in the client area (see [GetTopIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_topindex)) is shown as a ToolTip next to the scroll bar. An application can override the text displayed using the [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) callback function [SFTTREE_TOOLTIPSPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_tooltipsproc). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Sel *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sel* Defines the selection status of an item ([multiple selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree only). C ``` int WINAPI SftTree_GetSel(HWND hwndCtl, int index); int WINAPI SftTree_SetSel(HWND hwndCtl, int index, BOOL fSelect); int WINAPI SftTreeSplit_GetSel(HWND hwndCtl, int index); int WINAPI SftTreeSplit_SetSel(HWND hwndCtl, int index, BOOL fSelect); ``` C++ ``` int CSftTree::GetSel(int index) const; int CSftTree::SetSel(int index, BOOL fSelect = TRUE); int CSftTreeSplit::GetSel(int index) const; int CSftTreeSplit::SetSel(int index, BOOL fSelect = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the selection status is to be retrieved or set. Specify -1 to change all [tree items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_items) to the desired selection status *fSelect*. fSelect Set to TRUE to select the item, FALSE to deselect the item. ### Returns GetSel returns a value indicating the current selection status of the specified item, TRUE if the item is selected, FALSE if the item is not selected or -1 if an error occurred. SetSel returns 0 if the function was successful, otherwise -1 is returned. ### Comments The GetSel and SetSel functions define the selection status of an item (multiple selection tree only). This function applies to multiple selection trees only, and cannot be used with single selection tree controls. Multiple items can be selected using [SelItemRange](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemrange). To select or deselect an item in a single selection tree control use [SetCurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel) instead. [GetSelItemsArray](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemsarray) is used to retrieve all selected items. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelCount *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selcount* Returns the number of currently selected items ([multiple selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree only). C ``` int WINAPI SftTree_GetSelCount(HWND hwndCtl); int WINAPI SftTreeSplit_GetSelCount(HWND hwndCtl); ``` C++ ``` int CSftTree::GetSelCount() const; int CSftTreeSplit::GetSelCount() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value is the current number of selected items in a multiple selection tree control. ### Comments The GetSelCount function returns the number of currently selected items (multiple selection tree only). This function applies to multiple selection trees only, and cannot be used with single selection tree controls. [GetSelItemsArray](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemsarray) is used to retrieve all selected items. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelectionArea *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionarea* Defines the area where selection changes occur. C ``` int WINAPI SftTree_GetSelectionArea(HWND hwndCtl); void WINAPI SftTree_SetSelectionArea(HWND hwndCtl, int area); int WINAPI SftTreeSplit_GetSelectionArea(HWND hwndCtl); void WINAPI SftTreeSplit_SetSelectionArea(HWND hwndCtl, int area); ``` C++ ``` int CSftTree::GetSelectionArea() const; void CSftTree::SetSelectionArea(int area = SFTTREE_SELECTIONAREA_ALL); int CSftTreeSplit::GetSelectionArea() const; void CSftTreeSplit::SetSelectionArea(int area = SFTTREE_SELECTIONAREA_ALL); ``` ### Parameters hwndCtl The window handle of the tree control. area Defines the area where selection changes occur, when the user clicks the mouse button: | | | | --- | --- | | SFTTREE_SELECTIONAREA_ALL | Clicking anywhere on an item (all [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines), [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers), etc.) will change the selection. | | SFTTREE_SELECTIONAREA_ALLCELLS | Clicking on any cell of an item will change the selection. | | SFTTREE_SELECTIONAREA_CELL | Clicking on the cell in the first column will change the selection. | | SFTTREE_SELECTIONAREA_CELLTEXT | Clicking on the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) in the first column will change the selection. | | SFTTREE_SELECTIONAREA_ALLCELLS_ROWHDR | Clicking on the row header or any cell of an item will change the selection. | | SFTTREE_SELECTIONAREA_CELL_ROWHDR | Clicking on the row header or the cell in the first column will change the selection. | | SFTTREE_SELECTIONAREA_CELLTEXT_ROWHDR | Clicking on the row header or the cell text in the first column will change the selection. | ### Returns GetSelectionArea returns a value defining the area where selection changes occur, when the user clicks the mouse button. ### Comments The GetSelectionArea and SetSelectionArea functions define the area where selection changes occur. By using the SelectionArea function, the application can specify which areas of an item can cause a selection change when clicked. If the defined area is clicked, the selection changes. If an area of the item outside the defined area is clicked, only the current item ([GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex)) is changed. When using a limited area, such as SFTTREE_SELECTIONAREA_CELLTEXT, which only changes [selections](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) when the cell text is clicked, it is preferable to visually indicate this using the selection style [SFTTREE_SELECTION_CELL1](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle) (see SetSelectionStyle). In a multiple selection tree control, the Control key (in combination with directional keys) can be used to move the caret location without moving the current selection, unless the *style *SFTTREE_SELECTIONAREA_ALL is used, in which case the Control key is ignored. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelectionStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle* Defines the display style of selected items. C ``` int WINAPI SftTree_GetSelectionStyle(HWND hwndCtl); void WINAPI SftTree_SetSelectionStyle(HWND hwndCtl, int style); int WINAPI SftTreeSplit_GetSelectionStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetSelectionStyle(HWND hwndCtl, int style); ``` C++ ``` int CSftTree::GetSelectionStyle() const; void CSftTree::SetSelectionStyle(int style = SFTTREE_SELECTION_ALL); int CSftTreeSplit::GetSelectionStyle() const; void CSftTreeSplit::SetSelectionStyle(int style = SFTTREE_SELECTION_ALL); ``` ### Parameters hwndCtl The window handle of the tree control. style Defines the display style used for selected items. *Style* can be one of the following values: | | | | --- | --- | | SFTTREE_SELECTION_ALL | Highlights the entire item, including all [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell), the [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap) and [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap). When using the 3D display mode (enabled using [SetShow3D](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_show3d)), SFTTREE_SELECTION_ALL is equivalent to SFTTREE_SELECTION_CELLS. | | SFTTREE_SELECTION_CELLS | Highlights cells only. | | SFTTREE_SELECTION_CELL1 | Highlights the text in the first cell only. | | SFTTREE_SELECTION_CELLCURRENT | Highlights the entire current cell only. The current cell is always the cell in the first displayed column of the selected item(s). | | SFTTREE_SELECTION_CELL1FULL | Highlights the text in the first cell only. Identical to SFTTREE_SELECTION_CELL1, but the text background color of the selected item extends to the top and bottom of the cell. | | The value of an entry in the above table can be combined with the following value and passed as style parameter: | | | SFTTREE_SELECTION_OUTLINE | The selected display style from the above table is rendered using a rounded outline rectangle with a gradient fill. The outline colors and gradient fill are defined using the members of the [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors) structure. [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) support is required, otherwise SFTTREE_SELECTION_OUTLINE is ignored. | ### Returns GetSelectionStyle returns a value indicating the current display mode of selected items. ### Comments The GetSelectionStyle and SetSelectionStyle functions define the display style of selected items. SelectionStyle affects the *visual* representation of the selected items only. SftTree/DLL supports item selection only. Cell selection as typically found in a grid control is not supported. It is possible to emulate cell selection using cell foreground and background colors (and using [ShowFocus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfocus)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelectString *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectstring* Searches a string and selects the matching item. C ``` int SftTree_SelectStringCol(HWND hwndCtl, int start, int realCol, LPCTSTR lpszString); int SftTree_SelectString(HWND hwndCtl, int start, LPCTSTR lpszString); int WINAPI SftTree_SelectString_A(HWND hwndCtl, int start, LPCSTR lpszString); int WINAPI SftTree_SelectString_W(HWND hwndCtl, int start, LPCWSTR lpszString); int SftTreeSplit_SelectStringCol(HWND hwndCtl, int start, int realCol, LPCTSTR lpszString); int SftTreeSplit_SelectString(HWND hwndCtl, int start, LPCTSTR lpszString); int WINAPI SftTreeSplit_SelectString_A(HWND hwndCtl, int start, LPCSTR lpszString); int WINAPI SftTreeSplit_SelectString_W(HWND hwndCtl, int start, LPCWSTR lpszString); ``` C++ ``` int CSftTree::SelectString(int start, int realCol, LPCTSTR lpszString) const; int CSftTreeSplit::SelectString(int start, int realCol, LPCTSTR lpszString) const; ``` ### Parameters hwndCtl The window handle of the tree control. start The zero-based index of the item where the search for the specified string is to begin. realCol The zero-based column number to be searched. lpszString The string to be searched. ### Returns The return value is the zero-based index of the item where the string was found. -1 is returned if the string was not found or an error occurred. ### Comments The SelectString function searches a string and selects the matching item. The column text searched is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. The string *lpszString* is compared to the value returned by [GetText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text) for each item starting at *start*. The search starts at the item described by *start* and is restricted to the column specified by *realC**ol*. If an item with matching text is found, it is selected and its zero-based index is returned, otherwise -1 is returned. Only one column can be searched at a time. The comparison of *lpszString* and the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) is not case sensitive. If the cell text starts with the string in *lpszString*, it is considered a match. To find an exact match for *lpszString* use [FindStringExact](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstringexact). | SearchString | Cell Text | Match | Comment | | --- | --- | --- | --- | | ABC | abc | Yes | Same string, case is ignored | | abc | abc123 | Yes | Starts with *lpszString* | | abc | Thisabc | No | Doesn't start with *lpszString* | | abc | ab | No | Doesn't contain the complete *lpszString* | See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelectStringExact *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectstringexact* Searches a string and selects the matching item. C ``` int SftTree_SelectStringColExact(HWND hwndCtl, int start, int realCol, LPCTSTR lpszString); int SftTree_SelectStringExact(HWND hwndCtl, int start, LPCTSTR lpszString); int WINAPI SftTree_SelectStringExact_A(HWND hwndCtl, int start, LPCSTR lpszString); int WINAPI SftTree_SelectStringExact_W(HWND hwndCtl, int start, LPCWSTR lpszString); int SftTreeSplit_SelectStringColExact(HWND hwndCtl, int start, int realCol, LPCTSTR lpszString); int SftTreeSplit_SelectStringExact(HWND hwndCtl, int start, LPCTSTR lpszString); int WINAPI SftTreeSplit_SelectStringExact_A(HWND hwndCtl, int start, LPCSTR lpszString); int WINAPI SftTreeSplit_SelectStringExact_W(HWND hwndCtl, int start, LPCWSTR lpszString); ``` C++ ``` int CSftTree::SelectStringExact(int start, int realCol, LPCTSTR lpszString) const; int CSftTreeSplit::SelectStringExact(int start, int realCol, LPCTSTR lpszString) const; ``` ### Parameters hwndCtl The window handle of the tree control. start The zero-based index of the item where the search for the specified string is to begin. realCol The zero-based column number to be searched. lpszString The string to be searched. ### Returns The return value is the zero-based index of the item where the string was found. -1 is returned if the string was not found or an error occurred. ### Comments The SelectStringExact function searches a string and selects the matching item. The column text searched is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. The string *lpszString* is compared to the value returned by [GetText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text) for each item starting at *start*. The search starts at the item described by *start* and is restricted to the column specified by *realCol*. If an item with exactly matching text is found, it is selected and its zero-based index is returned, otherwise -1 is returned. Only one column can be searched at a time. The comparison of *lpszString* and the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) is not case sensitive. If the cell text is identical to the string in *lpszString*, it is considered a match. To find a loose match for *lpszString* use [FindString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_findstring). | SearchString | Cell Text | Match | Comment | | --- | --- | --- | --- | | ABC | abc | Yes | Same string, case is ignored | | abc | abc123 | No | Not the same string | | abc | Thisabc | No | Not the same string | | abc | ab | No | Not the same string | See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelItemRange *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemrange* Selects or deselects a range of items ([multiple selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree only). C ``` int WINAPI SftTree_SelItemRange(HWND hwndCtl, BOOL fSelect, int first, int last); int WINAPI SftTreeSplit_SelItemRange(HWND hwndCtl, BOOL fSelect, int first, int last); ``` C++ ``` int CSftTree::SelItemRange(BOOL fSelect, int first, int last); int CSftTreeSplit::SelItemRange(BOOL fSelect, int first, int last); ``` ### Parameters hwndCtl The window handle of the tree control. fSelect The desired selection status, TRUE to select the items, FALSE to deselect. first The first item of the range of items to de-/select. This value must be less or equal to *l**ast*. last The last item of the range of items to de-/select. This value must be greater or equal to *f**irst*. ### Returns The return value is 0 if successful, otherwise -1 is returned. ### Comments The SelItemRange function selects or deselects a range of items (multiple selection tree only). This function applies to multiple selection trees only, and cannot be used with single selection tree controls. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelItems *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitems* Fills an array with the index numbers of currently selected items. C ``` int WINAPI SftTree_GetSelItems(HWND hwndCtl, int max, LPINT lpItems); int WINAPI SftTreeSplit_GetSelItems(HWND hwndCtl, int max, LPINT lpItems); ``` C++ ``` int CSftTree::GetSelItems(int max, LPINT lpItems) const; int CSftTreeSplit::GetSelItems(int max, LPINT lpItems) const; ``` ### Parameters hwndCtl The window handle of the tree control. max The maximum number of index entries to retrieve. lpItems Address of an area where the index entries of up to *max* index entries will be returned. ### Returns GetSelItems returns the number of selected entries returned in *lpItems*, 0 if no items are selected or -1 if an error occurred. ### Comments This function applies to [multiple selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) trees only, and cannot be used with single selection tree controls. [GetSelItemsArray](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemsarray) is used to retrieve all selected items. The buffer *lpItems* where the index entries are returned has to be large enough to receive up to *max *integer values. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelItemsArray *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemsarray* Returns an array of [SFTTREE_SELENTRY](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_selentry) structures describing groups of selected items. C ``` void WINAPI SftTree_GetSelItemsArray(HWND hwndCtl, int* lpCount, LPCSFTTREE_SELENTRY* lpArray); void WINAPI SftTreeSplit_GetSelItemsArray(HWND hwndCtl, int* lpCount, LPCSFTTREE_SELENTRY* lpArray); ``` C++ ``` void CSftTree::GetSelItemsArray(int* lpCount, LPCSFTTREE_SELENTRY* lpArray) const; void CSftTreeSplit::GetSelItemsArray(int* lpCount, LPCSFTTREE_SELENTRY* lpArray) const; ``` ### Parameters hwndCtl The window handle of the tree control. lpCount A pointer to a field where the number of groups is returned. This is the number of SFTTREE_SELENTRY structures returned in *lpArray*. It is not the total number of selected items. [GetSelCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selcount) can be used to retrieve the total number of selected items. lpArray Address of an area where a pointer to the SFTTREE_SELENTRY structures is returned. ### Comments The GetSelItemsArray function returns an array of SFTTREE_SELENTRY structures describing groups of selected items. This function can be used for single and [multiple selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree controls. For a single selection tree control, [GetCurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel) can be used to retrieve the currently selected item. In a multiple selection tree control, many non contiguous groups of items may be selected. While [GetSelItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitems) returns an index for each selected item, GetSelItemsArray returns an array of groups of selected items. For a large number of selected items this is the preferred method. Note that the array becomes invalid as soon as a selection is changed using API functions or by the user. When using API calls to modify the selected items, the array has to be retrieved again using GetSelItemsArray. The array returned by GetSelItemsArray is read/only and cannot be modified. SetCurSel, [SetSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sel) and [SelItemRange](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemrange) should be used to select or deselect items. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SelTextOnly *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_seltextonly* SelTextOnly is provided for compatibility with SftTree/DLL 2.0 (and earlier) only. Applications should use the [SetSelectionStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle) function instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_CELL Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell* The SFTTREE_CELL structure is used with [GetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo) and SetCellInfo to retrieve and set [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) attributes and as part of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure (for a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource)). ``` typedef struct tagSftTreeCELL { COLORREF colorBg; // background color (SFTTREE_NOCOLOR if default wanted) COLORREF colorFg; // foreground color (SFTTREE_NOCOLOR if default wanted) COLORREF colorBgSel; // background color if selected (SFTTREE_NOCOLOR if default wanted) COLORREF colorFgSel; // foreground color if selected (SFTTREE_NOCOLOR if default wanted) HFONT hFont; // font handle (NULL if default wanted) #if defined(SFTTREE_OBSOLETE_4) HBITMAP hBmp; // cell bitmap (NULL if none wanted) #else HBITMAP obsoletehBmp; // not used #endif short flag; // misc flag #define SFTTREE_BMP_LEFT 0 // bitmap alignment #define SFTTREE_BMP_CENTER 0x01 #define SFTTREE_BMP_RIGHT 0x02 #define SFTTREE_BMP_VCENTER 0x10 #define SFTTREE_BMP_TOP 0x20 #define SFTTREE_BMP_BOTTOM 0x40 #define SFTTREE_TEXT_LEFT 0x0100 // text alignment, overrides column default #define SFTTREE_TEXT_CENTER 0x0200 #define SFTTREE_TEXT_RIGHT 0x0400 #define SFTTREE_TEXT_VCENTER 0x0800 #define SFTTREE_TEXT_TOP 0x1000 #define SFTTREE_TEXT_BOTTOM 0x2000 short flag2; #define SFTTREECELL_IGNORE 1 // ignored item (for optimal width calculation) #define SFTTREECELL_EDITIGNORE 2 // ignored item during cell editing #define SFTTREECELL_CONTENT_KEEPSIZE 0x04 // keep content window size (requires variable height tree control) #define SFTTREECELL_CONTENT_DISABLE 0x08 // don't enable/disable content window SFTTREE_DWORD_PTR cellData; // cell user data HWND hwndCell; // cell is using this content window SFT_PICTURE CellPicture1; // cell picture int flag3; #define SFTTREE_CELL_BGVERTICAL 1 // vertical gradient for background color colorBgStart/End (0 = default) #define SFTTREE_CELL_BGHORIZONTAL 2 // horizontal gradient for background color colorBgStart/End (0 = default) #define SFTTREE_CELL_PROGRESSVERTICAL 4// vertical gradient for progress bar color colorBgProgressStart/End (0 = default) #define SFTTREE_CELL_PROGRESSHORIZONTAL 8 // horizontal gradient for progress bar color colorBgProgressStart/End (0 = default) #define SFTTREE_CELL_PROGRESSFULL 0x8000 // full size progress bar #define SFTTREE_CELL_PROGRESSSMALL 0x4000 // 1/3 height/centered progress bar COLORREF colorBgEnd; // background color gradient fill end (combined with colorBg) COLORREF colorBgSelEnd; // background color gradient fill end if selected (SFTTREE_NOCOLOR if default wanted) COLORREF colorProgress; // progress bar color COLORREF colorProgressEnd; // progress bar color end color int progressVal, progressMax; // background progress bar indicator } SFTTREE_CELL, * LPSFTTREE_CELL; typedef const SFTTREE_CELL * LPCSFTTREE_CELL; ``` ### Members colorBg The background color used to draw the cell when the item is not selected. Specify [SFTTREE_NOCOLOR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor) to use the default background color. colorFg The foreground color used to draw the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) when the item is not selected. Specify SFTTREE_NOCOLOR to use the default text color. colorBgSel The background color used to draw the cell when the item is selected. Specify SFTTREE_NOCOLOR to use the default background color. colorFgSel The foreground color used to draw the cell text when the item is selected. Specify SFTTREE_NOCOLOR to use the default text color. hFont The font used to draw the cell text. If NULL is specified, the tree control's [default font](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_font) is used. The default font can be defined using the WM_SETFONT message or the CWnd::SetFont function. hBmp A bitmap handle defining the [cell picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap), displayed next to the cell text. Specify NULL to omit the cell picture. This member is provided for compatibility with older SftTree/DLL versions. The *CellPicture1* member should be used instead. This member is only accessible if the preprocessor symbol [SFTTREE_OBSOLETE_4](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_obsolete_4) is defined. flag The cell picture position, relative to the cell text. This member is ignored if *CellPicture1* is empty and *hBmp* is NULL. One value of each of the following tables can be combined and assigned to the *flag* member. | flag | Horizontal cell picture alignment | | --- | --- | | SFTTREE_BMP_LEFT | The cell picture is displayed to the left of the cell text. If no horizontal cell picture alignment value is specified, SFTTREE_BMP_LEFT is assumed. | | SFTTREE_BMP_CENTER | The cell picture is displayed in the center of the cell, the cell text is not shown. | | SFTTREE_BMP_RIGHT | The cell picture is displayed to the right of the cell text. | | flag | Vertical cell picture alignment | | --- | --- | | SFTTREE_BMP_VCENTER | The cell picture is vertically centered within the cell. If no vertical cell picture alignment value is specified, SFTTREE_BMP_VCENTER is assumed. | | SFTTREE_BMP_TOP | The cell picture is vertically aligned with the top of the cell. | | SFTTREE_BMP_BOTTOM | The cell picture is vertically aligned with the bottom of the cell. | | flag | Horizontal cell text alignment | | --- | --- | | *not specified* | If no horizontal cell text alignment is specified, the default defined using the *style* member of the [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) structure of the cell's column applies. | | SFTTREE_TEXT_LEFT | The cell text is left aligned within the cell. | | SFTTREE_TEXT_CENTER | The cell text is centered within the cell. | | SFTTREE_TEXT_RIGHT | The cell text is right aligned within the cell. | | flag | Vertical cell text alignment | | --- | --- | | *not specified* | If no vertical cell text alignment is specified, the default defined using the *style* member of the SFTTREE_COLUMN_EX structure of the cell's column applies. | | SFTTREE_TEXT_TOP | The cell text is aligned with the top of the cell. | | SFTTREE_TEXT_VCENTER | The cell text is vertically centered within the cell. | | SFTTREE_TEXT_BOTTOM | The cell text is aligned with the bottom of the cell. | flag2 Cell attributes. The following values can be combined: | flag2 | Cell attributes | | --- | --- | | 0 | No additional attributes. | | SFTTREECELL_IGNORE | The cell is ignored for optimal column width calculation using [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal) and [CalcOptimalColumnWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth). This attribute is typically used if certain cell contents are known to be unusually long, which would make a column too wide. | | SFTTREECELL_EDITIGNORE | The cell is ignored during [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). This attribute can be inspected by an application during cell editing and cell navigation to skip certain non-editable cells. While this attribute is not otherwise used by the tree control, it can be used and inspected by the application, simplifying cell editing. | | SFTTREECELL_CONTENT_KEEPSIZE | The original size of the [content window](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_contentwindows) is preserved and the cell size adjusts accordingly. While a column can still be smaller or larger than the content window width, the content window is not resized, it is merely clipped. Without SFTTREECELL_CONTENT_KEEPSIZE, a content window is resized in height and width to fit within the cell. SFTTREECELL_CONTENT_KEEPSIZE has no effect in a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control. | | SFTTREECELL_CONTENT_DISABLE | A content window is normally enabled and disabled as it is made visible or hidden. When SFTTREECELL_CONTENT_DISABLE is specified, the content window is always disabled, even if it is visible. | cellData Can be used by the application to store an application-defined value. hwndCell Defines the content window to be displayed by this cell. Specify NULL to omit the content window. CellPicture1 Defines the cell picture displayed next to the cell text. If the *hBmp* member defines a picture, *CellPicture1* is ignored. flag3 Cell attributes defining background and [progress bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_progressbar) attributes. The following values can be combined: | flag3 | Cell attributes | | --- | --- | | 0 | No additional attributes. Column defaults are used (see SFTTREE_COLUMN_EX, *flag3*). | | SFTTREE_CELL_BGVERTICAL | If the cell (or column defaults) define a cell background color (*colorBg*) and an ending color (*colorBgEnd*) resulting in a gradient fill, the area is filled using a vertical gradient fill. If neither SFTTREE_CELL_BGVERTICAL nor SFTTREE_CELL_BGHORIZONTAL is specified, the column default is used (see SFTTREE_COLUMN_EX, *flag3*). | | SFTTREE_CELL_BGHORIZONTAL | If the cell (or column defaults) define a cell background color (*colorBg*) and an ending color (*colorBgEnd*) resulting in a gradient fill, the area is filled using a horizontal gradient fill. If neither SFTTREE_CELL_BGVERTICAL nor SFTTREE_CELL_BGHORIZONTAL is specified, the column default is used (see SFTTREE_COLUMN_EX, *flag3*). | | SFTTREE_CELL_PROGRESSVERTICAL | If the cell defines a progress bar (*progressMax*) with a color (*colorProgress*) and an ending color (*colorProgressEnd*) resulting in a gradient fill, the area is filled using a vertical gradient fill. If neither SFTTREE_CELL_PROGRESSVERTICAL nor SFTTREE_CELL_PROGRESSHORIZONTAL is specified, the column default is used (see SFTTREE_COLUMN_EX, *flag3*). | | SFTTREE_CELL_PROGRESSHORIZONTAL | If the cell defines a progress bar (*progressMax*) with a color (*colorProgress*) and an ending color (*colorProgressEnd*) resulting in a gradient fill, the area is filled using a horizontal gradient fill. If neither SFTTREE_CELL_PROGRESSVERTICAL nor SFTTREE_CELL_PROGRESSHORIZONTAL is specified, the column default is used (see SFTTREE_COLUMN_EX, *flag3*). | | SFTTREE_CELL_PROGRESSFULL | If the cell defines a progress bar (*progressMax*), the full height of the cell is used to render the progress bar. If neither SFTTREE_CELL_PROGRESSFULL nor SFTTREE_CELL_PROGRESSSMALL is specified, the column default is used (see SFTTREE_COLUMN_EX, *flag3*). | | SFTTREE_CELL_PROGRESSSMALL | If the cell defines a progress bar (*progressMax*), the progress bar is vertically centered within the cell and is approximately 1/3 of the full height of the cell. The defined background colors (*colorBg*) fill the remainder of the cell. If neither SFTTREE_CELL_PROGRESSFULL nor SFTTREE_CELL_PROGRESSSMALL is specified, the column default is used (see SFTTREE_COLUMN_EX, *flag3*). | colorBgEnd The ending background color used to draw the cell when the item is not selected. Specify SFTTREE_NOCOLOR to use the default background color. If *colorBg* is not defined, *colorBgEnd* is ignored. *colorBgEnd* combined with *colorBg* define a gradient fill used to render the cell's background. The gradient fill orientation can be defined using *flag3*. colorBgSelEnd The ending background color used to draw the cell when the item is selected. Specify SFTTREE_NOCOLOR to use the default background color. If *colorBgSel* is not defined, *colorBgSelEnd* is ignored. *colorBgSelEnd* combined with *colorBgSel* define a gradient fill used to render the cell's background. The gradient fill orientation can be defined using *flag3*. colorProgress The color used to draw the progress bar. Specify SFTTREE_NOCOLOR to use the default background color. The progress bar is only shown if *progressMax* has been set to a value greater than 0. colorProgressEnd The ending color used to draw the progress bar. Specify SFTTREE_NOCOLOR to use the default background color. If *colorProgress* is not defined, *colorProgressEnd* is ignored. *colorProgressEnd* combined with *colorProgress* define a gradient fill used to render the progress bar. The gradient fill orientation can be defined using *flag3*. The progress bar is only shown if *progressMax* has been set to a value greater than 0. progressVal Defines the current value for the progress bar. Allowable values for *progressVal* are 0 to *progressMax*. The progress bar is only shown if *progressMax* has been set to a value greater than 0. The progress bar is rendered as the background of the cell, starting at the left edge. Its horizontal size is proportional to the *progressVal* value. Once *progressVal* reaches the maximum defined using *progressMax*, the progress bar fills the entire cell. progressMax Defines the maximum value for the progress bar. The progress bar is only shown if *progressMax* has been set to a value greater than 0. The progress bar is rendered as the background of the cell, starting at the left edge. Its horizontal size is proportional to the *progressVal* value. Once *progressVal* reaches the maximum defined using *progressMax*, the progress bar fills the entire cell. ### Comments The SFTTREE_CELL structure is used with GetCellInfo and SetCellInfo to retrieve and set cell attributes and as part of the SFTTREE_ITEM structure (for a virtual data source). GetCellInfo and SetCellInfo usually retrieve and set attributes for one cell described by the [SFTTREE_CELLINFOPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cellinfoparm) structure members *index* and *iCol. * SetCellInfo can be used to set all cells of an item to the same values using one call to SetCellInfo, instead of multiple calls, one for each cell. By setting the SFTTREE_CELLINFOPARM structure members *index* to the item index and *iCol* to -1, the values of the provided SFTTREE_CELL structure are copied and assigned to each cell. The following structure members are copied: colorBg, colorFg, colorBgSel, colorFgSel, hFont, flag, flag2, flag3, colorBgEnd, colorBgSelEnd, colorProgress, colorProgressEnd. This is usually used to propagate custom color values to all cells of an item. An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). A cell may have an associated cell picture without the picture component actually being visible. The cell picture doesn't become visible until the cell picture size has been registered using SetCellInfo by setting the *index* member of the SFTTREE_CELLINFOPARM structure to -1. Only one picture is used to register the picture size. After registering the picture size, any number of pictures may be used. In a fixed height tree control, all cell pictures used for all cells must be the same size. In a variable height tree control, cell pictures can be of varying sizes. The (largest) cell picture size must be registered using SetCellInfo. A new picture size can be registered at any time, but all cell pictures in use must be replaced by pictures of the new size (or smaller). Fonts are owned by the application and the associated font handles have to remain valid as long as the tree control uses them. Fonts have to be deleted using DeleteObject once they are no longer needed. Cell text can be retrieved using [GetText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text) and modified using SetText. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_CELLINFOPARM Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cellinfoparm* The SFTTREE_CELLINFOPARM structure is used as parameter for [GetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo) and SetCellInfo to retrieve and set [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) attributes. ``` typedef struct tagSftTreeCellInfoParm { int version; // no longer used (set to 0) int index; // item index int iCol; // column number SFTTREE_CELL Cell; // cell information } SFTTREE_CELLINFOPARM, * LPSFTTREE_CELLINFOPARM; typedef const SFTTREE_CELLINFOPARM * LPCSFTTREE_CELLINFOPARM; ``` ### Members version This member is no longer used and should be set to 0. index An integer value specifying the zero-based index of the item whose attributes are to be set or retrieved. This value can be set to -1 to register a [cell picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap) size. See SetCellInfo for more information. iCol An integer value specifying the zero-based column number of the cell whose attributes are to be set or retrieved. Cell A structure describing the cell's attributes. See [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) for more information. ### Comments The SFTTREE_CELLINFOPARM structure is used as parameter for GetCellInfo and SetCellInfo to retrieve and set cell attributes. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_CLASS Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_class* The SFTTREE_CLASS preprocessor symbol defines the window class name of a tree control without [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). ``` #define SFTTREE_CLASS "SftTreeControl80" ``` ### Comments The SFTTREE_CLASS preprocessor symbol defines the window class name of a tree control without splitter bar. [SFTTREESPLIT_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttreesplit_class) is the window class name of a tree control with a splitter bar. The actual class name (SftTreeControl80) usually changes between SftTree/DLL releases. When defining a tree control using the window class SFTTREE_CLASS, the functions SftTree_xxx or the C++ class [CSftTree](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) must be used. This preprocessor symbol is normally used when creating a control window dynamically using CreateWindow(Ex). When designing a dialog resource (see "[Creating a Dialog Resource](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_vc)"), the window class name must be entered as-is and the preprocessor symbol cannot be used. See Also C/C++ API | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_COLORS Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors* The SFTTREE_COLORS structure is used with [GetCtlColors](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ctlcolors) and SetCtlColors to retrieve and set a tree control's color attributes. ``` typedef struct tagSftTreeTreeColors { COLORREF colorBg; // background color COLORREF colorFg; // foreground color COLORREF colorFgGrayed; // grayed text foreground color COLORREF colorSelBg; // selection background color COLORREF colorSelFg; // selection foreground color COLORREF colorDarkEdge; // 3D dark edge COLORREF colorLightEdge; // 3D light edge COLORREF colorColHdrBg; // column header background color COLORREF colorColHdrFg; // column header foreground color COLORREF colorColHdrFgGrayed; // column header grayed text color COLORREF colorColHdrDarkEdge; // column header 3D dark edge COLORREF colorColHdrLightEdge; // column header 3D light edge COLORREF colorRowHdrBg; // row header background color COLORREF colorRowHdrFg; // row header foreground color COLORREF colorRowHdrSelBg; // row header selected background color COLORREF colorRowHdrSelFg; // row header selected foreground color COLORREF colorRowHdrFgGrayed; // row header grayed text color COLORREF colorRowHdrDarkEdge; // row header 3D dark edge COLORREF colorRowHdrLightEdge; // row header 3D light edge COLORREF colorRowColHdrBg; // row/column header background color COLORREF colorRowColHdrFg; // row/column header foreground color COLORREF colorRowColHdrFgGrayed; // row/column header grayed text color COLORREF colorRowColHdrDarkEdge; // row/column header 3D dark edge COLORREF colorRowColHdrLightEdge; // row/column header 3D light edge COLORREF colorGridVert; // vertical gridline color COLORREF colorGridHorz; // horizontal gridline color COLORREF colorDropHighlight; // drop highlight color COLORREF colorTreeLines; // tree line color COLORREF colorTreeLinesGrayed; // tree line color (disabled control) COLORREF colorOddBg; // background color in odd rows COLORREF colorOddFg; // foreground color in even rows COLORREF colorToolTipBg; // tooltip background color COLORREF colorToolTipFg; // tooltip foreground color COLORREF colorSelBgNoFocus; // selection background color - nofocus COLORREF colorSelFgNoFocus; // selection foreground color - nofocus COLORREF selectionOutlineBorder; // selection outline colors COLORREF selectionInnerBorder; COLORREF selectionInnerFill1; COLORREF selectionInnerFill2; COLORREF selectionFlybyOutlineBorder;// selection outline colors COLORREF selectionFlybyInnerBorder; COLORREF selectionFlybyInnerFill1; COLORREF selectionFlybyInnerFill2; COLORREF nofocusOutlineBorder; // selection outline colors when control doesn't have the input focus COLORREF nofocusInnerBorder; COLORREF nofocusInnerFill1; COLORREF nofocusInnerFill2; COLORREF flybyOutlineBorder; // flyby highlighting outline colors COLORREF flybyInnerBorder; COLORREF flybyInnerFill1; COLORREF flybyInnerFill2; COLORREF droptargetOutlineBorder; // drop target outline colors COLORREF droptargetInnerBorder; COLORREF droptargetInnerFill1; COLORREF droptargetInnerFill2; COLORREF colorColFtrBg; // column footer background color COLORREF colorColFtrFg; // column footer foreground color COLORREF colorColFtrFgGrayed; // column footer grayed text color COLORREF colorColFtrDarkEdge; // column footer 3D dark edge COLORREF colorColFtrLightEdge; // column footer 3D light edge COLORREF colorRowColFtrBg; // row/column footer background color COLORREF colorRowColFtrFg; // row/column footer foreground color COLORREF colorRowColFtrFgGrayed; // row/column footer grayed text color COLORREF colorRowColFtrDarkEdge; // row/column footer 3D dark edge COLORREF colorRowColFtrLightEdge; // row/column footer 3D light edge COLORREF colorEdgeVertical; // vertical edge around headers, footers COLORREF colorEdgeHorizontal; // horizontal edge around row headers, row and column headers COLORREF colorSortIndicator; // sort indicator color (non-themed only) COLORREF res6, res7, res8, res9, res10, res11, res12, res13, res14; } SFTTREE_COLORS, * LPSFTTREE_COLORS; typedef const SFTTREE_COLORS * LPCSFTTREE_COLORS; ``` ### Members colorBg The default background color used to draw items that are not selected. [Columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) can override the default background color using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns). [Cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) can override the default background color using [SetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo). If a selected item uses a selection style (see [SetSelectionStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle)) that uses the *colorSelBg* value for only portions of the item, the color *colorBg* is used for the remainder of the item. colorFg The default foreground color used to draw items that are not selected. Columns can override the default foreground color using SetColumns. Cells can override the default foreground color using SetCellInfo. If an item is disabled (see [SetItemStatus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemstatus)), the *colorFgGrayed* value is used instead of *colorFg*. If a selected item uses a selection style (see SetSelectionStyle) that uses the *colorSelFg* value for only portions of the item, the color *colorFg* is used for the remainder of the item. colorFgGrayed The default foreground color used to draw items that are disabled. Cells can override the foreground color for disabled items using SetCellInfo. colorSelBg The default background color used to draw items (rows) that are selected. Columns can override the default background color using SetColumns. Cells can override the background color using SetCellInfo. If a selected item uses a selection style (see SetSelectionStyle) that uses the *colorSelBg* value for only portions of the item, the color *colorBg* is used for the remainder of the item. colorSelFg The default foreground color used to draw items that are selected. Columns can override the default foreground color using SetColumns. Cells can override the foreground color using SetCellInfo. If an item is disabled (see SetItemStatus), the *colorFgGrayed* value is used instead of the *colorSelFg* value. If a selected item uses a selection style (see SetSelectionStyle) that uses the *colorSelFg* value for only portions of the item, the *colorFg* value is used for the remainder of the item. colorDarkEdge The color used to draw the shadow edge of items when items are displayed in a 3D fashion (see [SetShow3D](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_show3d)). colorLightEdge The color used to draw the highlighted edge of items when items are displayed in a 3D fashion (see SetShow3D). colorColHdrBg The default background color for [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers). Individual column headers can override the color using [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex), headerColorBg. colorColHdrFg The default foreground color for column headers. Individual column headers can override the color using SFTTREE_COLUMN_EX, headerColorFg. colorColHdrFgGrayed The foreground color used to draw disabled column headers. SetColumns is used to enable and disable individual column headers. Individual column headers can override the color using SFTTREE_COLUMN_EX, headerColorFgDisabled. colorColHdrDarkEdge The color used to draw the dark edge of the column header. All column headers use the same shadow color and cannot be defined individually. colorColHdrLightEdge The color used to draw the highlighted edge of the column headers. All column headers use the same highlight color and cannot be defined individually. colorRowHdrBg The default background color used to draw [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) of items that are not selected. Items can override the row header background color using [SetRowInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowinfo). colorRowHdrFg The default foreground color used to draw row headers of items that are not selected. Items can override the row header foreground color using SetRowInfo. colorRowHdrSelBg The default background color used to draw an item's row header that is selected. Items can override the row header's background color using SetRowInfo. colorRowHdrSelFg The default foreground color used to draw an item's row header that is selected. Items can override the row header's foreground color using SetRowInfo. colorRowHdrFgGrayed The default foreground color used to draw an item's row header that is disabled. Items can override the row header's foreground color using SetRowInfo. colorRowHdrDarkEdge The color used to draw the dark edge of row headers. All row headers use the same shadow color and cannot be defined individually. colorRowHdrLightEdge The color used to draw the highlighted edge of row headers. All row headers use the same highlight color and cannot be defined individually. colorRowColHdrBg The [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header)'s background color. colorRowColHdrFg The row/column header's foreground color. colorRowColHdrFgGrayed The foreground color used to draw a disabled row/column header. colorRowColHdrDarkEdge The color used to draw the dark edge of the row/column header. colorRowColHdrLightEdge The color used to draw the highlighted edge of the row/column header. colorGridVert The color used to draw vertical [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines). If *colorGridVert* is set to [SFTTREE_NOCOLOR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor), a suitable default color is used based on the operating system and current Windows theme used. colorGridHorz The color used to draw horizontal grid lines. If *colorGridHorz* is set to SFTTREE_NOCOLOR, a suitable default color is used based on the operating system and current Windows theme used. colorDropHighlight The color used to display the drop target item of a [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) operation. The drop target is displayed using *colorDropHighlight* based on the values specified using [SetDropHighlightStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlightstyle) and [SetDropHighlight](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drophighlight). colorTreeLines The color used to draw connecting [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines). colorTreeLinesGrayed The color used to draw connecting tree lines when an item (see SetItemStatus) or the control is disabled (see EnableWindow). colorOddBg The background color used to draw items in odd numbered rows that are not selected. Cells can override the background color using SetCellInfo. Specify SFTTREE_NOCOLOR to use the default background color *colorBg*. colorOddFg The foreground color used to draw items in odd numbered rows that are not selected. Cells can override the foreground color using SetCellInfo. Specify SFTTREE_NOCOLOR to use the default foreground color *colorFg*. colorToolTipBg The background color used to draw a ToolTip or ScrollTip. Specify SFTTREE_NOCOLOR to use the default background color. For cell [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips), the default is the background color of the cell or column. For [ScrollTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_scrolltips), the default is defined using Control Panel (see GetSysColor(COLOR_INFOBK)). colorToolTipFg The foreground color used to draw a ToolTip or ScrollTip. Specify SFTTREE_NOCOLOR to use the default foreground color. For cell ToolTips, the default is the foreground color of the cell or column. For ScrollTips, the default is defined using Control Panel (see GetSysColor(COLOR_INFOTEXT)). colorSelBgNoFocus The background color used to draw a selected item when the tree control does not have the input focus. If the tree control has the input focus, the color *colorSelBg* is used instead. This color value is only used if [SetNoFocusStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_nofocusstyle)(SFTTREE_NOFOCUS_KEEPSEL) is used. colorSelFgNoFocus The foreground color used to draw a selected item when the tree control does not have the input focus. If the tree control has the input focus, the color *colorSelFg* is used instead. This color value is only used if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is used. selectionOutlineBorder The outermost border color used to render the rounded selection outline rectangle of a selected item. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). selectionInnerBorder The inner border color used to render the rounded selection outline rectangle of a selected item. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). selectionInnerFill1 The starting color (top) used to gradient fill the inside of the rounded selection outline rectangle of a selected item. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). selectionInnerFill2 The ending color (bottom) used to gradient fill the inside of the rounded selection outline rectangle of a selected item. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). selectionFlybyOutlineBorder The outermost border color used to render the rounded selection outline rectangle of a selected item that is highlighted due to [flyby highlighting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_flyby_highlighting). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). selectionFlybyInnerBorder The inner border color used to render the rounded selection outline rectangle of a selected item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). selectionFlybyInnerFill1 The starting color (top) used to gradient fill the rounded selection outline rectangle of a selected item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). selectionFlybyInnerFill2 The ending color (bottom) used to gradient fill the rounded selection outline rectangle of a selected item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined. nofocusOutlineBorder The outermost border color used to render the rounded selection outline rectangle of a selected item, when the tree control does not have the input focus. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined. nofocusInnerBorder The inner border color used to render the rounded selection outline rectangle of a selected item, when the tree control does not have the input focus. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined. nofocusInnerFill1 The starting color (top) used to gradient fill the inside of the rounded selection outline rectangle of a selected item, when the tree control does not have the input focus. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined. nofocusInnerFill2 The ending color (bottom) used to gradient fill the inside of the rounded selection outline rectangle of a selected item, when the tree control does not have the input focus. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE) and if SetNoFocusStyle(SFTTREE_NOFOCUS_KEEPSEL) is defined. flybyOutlineBorder The outermost border color used to render the rounded selection outline rectangle of an item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). flybyInnerBorder The inner border color used to render the rounded selection outline rectangle of an item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). flybyInnerFill1 The starting color (top) used to gradient fill the rounded selection outline rectangle of an item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). flybyInnerFill2 The ending color (bottom) used to gradient fill the rounded selection outline rectangle of an item that is highlighted due to flyby highlighting. This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). droptargetOutlineBorder The outermost border color used to render the rounded selection outline rectangle of an item that is the current drop target item (see SetDropHighlight). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). droptargetInnerBorder The inner border color used to render the rounded selection outline rectangle of an item that is the current drop target item (see SetDropHighlight). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). droptargetInnerFill1 The starting color (top) used to gradient fill the rounded selection outline rectangle of an item that is the current drop target item (see SetDropHighlight). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). droptargetInnerFill2 The ending color (bottom) used to gradient fill the rounded selection outline rectangle of an item that is the current drop target item (see SetDropHighlight). This color settings only takes effect if a rounded selection outline rectangle is used (see SFTTREE_SELECTION_OUTLINE). colorColFtrBg The default background color for [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers). Individual columns can override the color using SFTTREE_COLUMN_EX, footerColorBg. colorColFtrFg The default foreground color for column footers. Individual columns can override the color using SFTTREE_COLUMN_EX, footerColorFg. colorColFtrFgGrayed The foreground color used to draw disabled column footers. SetColumns is used to enable and disable individual column footers. Individual column footers can override the color using SFTTREE_COLUMN_EX, footerColorFgDisabled. colorColFtrDarkEdge The color used to draw the dark edge of the column footers. All column footers use the same shadow color and cannot be defined individually. colorColFtrLightEdge The color used to draw the highlighted edge of the column footers. All column footers use the same highlight color and cannot be defined individually. colorRowColFtrBg The [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer)'s background color. colorRowColFtrFg The row/column footer's foreground color. colorRowColFtrFgGrayed The foreground color used to draw a disabled row/column footer. colorRowColFtrDarkEdge The color used to draw the dark edge of the row/column footer. colorRowColFtrLightEdge The color used to draw the highlighted edge of the row/column footer. colorEdgeVertical The color used to draw the vertical edge around column headers, column footers, row headers, row/column headers and row/column footers. Depending on whether [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) are used, this color may not be used. colorEdgeHorizontal The color used to draw the horizontal edge around column headers, column footers, row headers, row/column headers and row/column footers. Depending on whether Windows themes are used, this color may not be used. colorSortIndicator The color used to draw the [sort indicator](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_sortindicator) in column headers. Depending on whether Windows themes are used, this color may not be used. ### Comments The SFTTREE_COLORS structure is used with GetCtlColors and SetCtlColors to retrieve and set a tree control's color attributes. An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). Many color settings have no effect when Windows themes are used. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_COLUMN Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column* The SFTTREE_COLUMN structure is used with [GetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) and SetColumns to retrieve and set column attributes. SFTTREE_COLUMN is provided for compatibility with SftTree 1.0 only. The structure [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) should be used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_COLUMN_EX Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex* The SFTTREE_COLUMN_EX structure is used with [GetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) and SetColumns to retrieve and set column attributes. ``` typedef struct tagSftTreeColumnEx { DWORD res1; // reserved - must be 0 DWORD res2; // reserved - must be 0 int width; // column width DWORD style; // column default cell alignment and attributes // use ES_LEFT, ES_CENTER, ES_RIGHT edit window styles // SFTTREE_MULTILINE if more than one text line #define SFTTREE_MULTILINE ES_MULTILINE // allow \r\n #define SFTTREE_WRAP 0x0010L // wrap text (always allows \r\n) #define SFTTREE_TOOLTIP 0x0008L // enable tooltips DWORD styleTitle; // column header title style // use ES_LEFT, ES_CENTER, ES_RIGHT edit window styles // and SFTTREE_HEADER_DISABLED/UP // Do not write to the string addressed directly, replace the pointer instead LPTSTR lpszTitle; // column header title LPTSTR lpszOrig; // original header column title - do not alter #if defined(SFTTREE_OBSOLETE_4) HBITMAP hBmp; // bitmap (NULL if none wanted) #else HBITMAP obsoletehBmp; // not used #endif short flag; // misc. flag (for bitmap position) short flag2; // reserved short flag3; // background gradient and progress bar information #define SFTTREE_COL_BGVERTICAL 1 // vertical gradient for background color colorBgStart/End (0 = default) #define SFTTREE_COL_BGHORIZONTAL 2 // horizontal gradient for background color colorBgStart/End (0 = default) #define SFTTREE_COL_PROGRESSVERTICAL 4 // vertical gradient for progress bar color colorBgProgressStart/End (0 = default) #define SFTTREE_COL_PROGRESSHORIZONTAL 8 // horizontal gradient for progress bar color colorBgProgressStart/End (0 = default) #define SFTTREE_COL_PROGRESSFULL 0x8000 // full size progress bar #define SFTTREE_COL_PROGRESSSMALL 0x4000 // 1/3 height/centered progress bar short flag4; // reserved COLORREF colorBg; // column's cell default background color COLORREF colorFg; // column's cell default foreground color COLORREF colorBgSel; // column's cell default background color if selected COLORREF colorFgSel; // column's cell default foreground color if selected /* Column display */ int realPos; // column real position int dispPos; // column display position short colFlag; // column flag #define SFTTREE_COL_LOCKED 0x01 // lock column (can't resize) #define SFTTREE_COL_KEEPPOS 0x02 // column must stay in position #define SFTTREE_COL_MERGE 0x04 // column can merge into next #define SFTTREE_COL_MERGEINTO 0x08 // column allows merge into from previous #define SFTTREE_COL_SORTED_ASC 0x10 // column header shows sort ascending #define SFTTREE_COL_SORTED_DESC 0x20 // column header shows sort descending short minWidth; // minimum column width short flag6; // reserved short flag7; // reserved SFT_PICTURE Picture1; // column header picture int fColorsOverrideTheme; // TRUE if this header's colors override windows theme colors COLORREF headerColorBg; // column header's background color COLORREF headerColorFg; // column header's foreground color COLORREF headerColorBgSel; // column header's background color if selected COLORREF headerColorFgSel; // column header's foreground color if selected COLORREF headerColorBgDisabled; // column header's background color if disabled COLORREF headerColorFgDisabled; // column header's foreground color if disabled COLORREF headerColorBgSelDisabled; // column header's background color if disabled and selected COLORREF headerColorFgSelDisabled; // column header's foreground color if disabled and selected COLORREF colorBgEnd; // column's cell default background color (ending color for gradient fill) COLORREF colorBgSelEnd; // column's cell default background color if selected (ending color for gradient fill) COLORREF colorProgress; // column's default progressbar color COLORREF colorProgressEnd; // column's default progressbar color (ending color for gradient fill) // footer DWORD styleFooterTitle; // column footer title style // use ES_LEFT, ES_CENTER, ES_RIGHT edit window styles and SFTTREE_HEADER_DISABLED/UP // Do not write to the string addressed directly, replace the pointer instead LPTSTR lpszFooterTitle; // column footer title LPTSTR lpszFooterOrig; // original footer column title - do not alter SFT_PICTURE footerPicture; // column footer picture short flagFooter; // misc. flag (for bitmap position) int fFooterColorsOverrideTheme; // TRUE if this footer's colors override windows theme colors COLORREF footerColorBg; // column footer's background color COLORREF footerColorFg; // column footer's foreground color COLORREF footerColorBgSel; // column footer's background color if selected COLORREF footerColorFgSel; // column footer's foreground color if selected COLORREF footerColorBgDisabled; // column footer's background color if disabled COLORREF footerColorFgDisabled; // column footer's foreground color if disabled COLORREF footerColorBgSelDisabled; // column footer's background color if disabled and selected COLORREF footerColorFgSelDisabled; // column footer's foreground color if disabled and selected } SFTTREE_COLUMN_EX, * LPSFTTREE_COLUMN_EX; typedef const SFTTREE_COLUMN_EX * LPCSFTTREE_COLUMN_EX; ``` ### Members width The width of the column (in pixels). Specify a width greater or equal to 0. A hidden column has a width of 0. The last column also must have a defined width, even if it is defined as an [open-ended](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_openended) column (see SetOpenEnded). An open-ended last column will display the complete text specified for the last (or only) column and never truncate any data. A *fixed-width* last column is defined with a specified width and any data which doesn't fit is truncated. The *width* defined must be larger or equal to *minWidth*. *minWidth* defines the minimum width of the column. For compatibility with earlier releases of SftTree/DLL (2.0 and lower), the last column can have this member specified as -1, which makes the last column an *open-ended* column. New applications should use SetOpenEnded instead. style The item style and alignment default used for the column. This value applies to all [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) in this column. One value of each of the following tables can be combined and assigned to the *style* member. | style | Horizontal cell text alignment | | --- | --- | | *not specified* | If no horizontal [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) alignment is specified, the default is ES_LEFT. | | ES_LEFT | The cell text is left aligned within the cell. Cells can override this default by defining new alignment values using the [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell), *flag* member. | | ES_CENTER | The cell text is centered within the cell. Cells can override this default by defining new alignment values using the SFTTREE_CELL, *flag* member. | | ES_RIGHT | The cell text is right aligned within the cell. Cells can override this default by defining new alignment values using the SFTTREE_CELL, *flag* member. | | style | Vertical cell text alignment | | --- | --- | | *not specified* | If no vertical cell text alignment is specified, the default is SFTTREE_VCENTER. | | SFTTREE_TOP | The cell text and [cell picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap) are aligned with the top of the cell. Cells can override this default by defining new alignment values using the SFTTREE_CELL, *flag* member. | | SFTTREE_VCENTER | The cell text and cell picture are vertically centered within the cell. Cells can override this default by defining new alignment values using the SFTTREE_CELL, *flag* member. | | SFTTREE_BOTTOM | The cell text and cell picture are aligned with the bottom of the cell. Cells can override this default by defining new alignment values using the SFTTREE_CELL, *flag* member. | The *style* value can optionally be combined with one or more of the following values: | | | | --- | --- | | SFTTREE_MULTILINE | Cell text can contain new-line characters ('\n') to indicate the start of a new line. Also use [SetItemLines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlines), so the item height can be properly determined. | | SFTTREE_WRAP | Cell text will word wrap within the available cell width and height. SFTTREE_MULTILINE must also be specified for word wrap. | | SFTTREE_TOOLTIP | [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) are displayed in this column for truncated cells. | styleTitle The [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) style used for the column header. If column header text contains more than one line of text, the [SetMultilineHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilineheader) function must be used. One value of each of the following tables can be combined and assigned to the *styleTitle* member. | styleTitle | Horizontal column header text alignment | | --- | --- | | *not specified* | If no horizontal column header text alignment is specified, the default is ES_LEFT. | | ES_LEFT | The column header text is left aligned within the column header. | | ES_CENTER | The column header text is centered within the column header. | | ES_RIGHT | The column header is right aligned within the column header. | | styleTitle | Vertical column header text alignment | | --- | --- | | *not specified* | If no vertical column header alignment is specified, the default is SFTTREE_VCENTER. | | SFTTREE_TOP | The column header text and picture are aligned with the top of the column header. | | SFTTREE_VCENTER | The column header text and picture are vertically centered within the column header. | | SFTTREE_BOTTOM | The column header text and picture are aligned with the bottom of the column header. | The *styleTitle* value can optionally be combined with one or more of the following values: | | | | --- | --- | | SFTTREE_HEADER_DISABLED | The column header for the column is disabled, cannot be clicked and is displayed in a "grayed" fashion. The column contents (cells) are otherwise unaffected. | | SFTTREE_HEADER_UP | The column header button will automatically return to its "up" position when clicked. | | SFTTREE_HEADER_DROPDOWN | The column header has a [dropdown/filter button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dropdown) rendered as a dropdown button. SFTTREE_HEADER_DROPDOWN cannot be combined with SFTTREE_HEADER_FILTER. | | SFTTREE_HEADER_FILTER | The column header has a dropdown/filter button rendered as a filter button. SFTTREE_HEADER_FILTER cannot be combined with SFTTREE_HEADER_DROPDOWN. | lpszTitle The column header title. [Header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_header) text can contain multiple lines of text using cr-lf (\r\n). SetMultilineHeader must be used to enable multiple lines of text. This member may be NULL to indicate that no title is specified for the column. lpszOrig Reserved. Set to NULL when initializing a SFTTREE_COLUMN_EX structure. hBmp The handle of the picture to display in the column's header. Specify NULL to omit the column picture. All column header pictures must be the same size. This member is provided for compatibility with older SftTree/DLL versions. The *Picture1* member should be used instead. This member is only accessible if the preprocessor symbol [SFTTREE_OBSOLETE_4](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_obsolete_4) is defined. flag The picture location relative to the column header text. One value of each of the following tables can be combined and assigned to the *flag* member. | flag | Horizontal column header picture alignment | | --- | --- | | SFTTREE_BMP_LEFT | The column header picture is displayed to the left of the cell text. If no horizontal column header picture alignment value is specified, SFTTREE_BMP_LEFT is assumed. | | SFTTREE_BMP_CENTER | The column header picture is displayed in the center of the cell, the column header text is not shown. | | SFTTREE_BMP_RIGHT | The column header picture is displayed to the right of the column header text. | | flag | Vertical column header picture alignment | | --- | --- | | SFTTREE_BMP_VCENTER | The column header picture is vertically centered within the column header. If no vertical column header alignment value is specified, SFTTREE_BMP_VCENTER is assumed. | | SFTTREE_BMP_TOP | The column header picture is vertically aligned with the top of the column header. | | SFTTREE_BMP_BOTTOM | The column header picture is vertically aligned with the bottom of the column header. | colorBg The default background color used to draw cells that are not selected. Cells can override the default background color using SFTTREE_CELL, *colorBg*. colorFg The default foreground color used to draw cells that are not selected. Cells can override the default foreground color using SFTTREE_CELL, *colorFg*. colorBgSel The default background color used to draw cells that are selected. Cells can override the background color using SFTTREE_CELL, *colorBgSel*. colorFgSel The default foreground color used to draw cells that are selected. Cells can override the foreground color using SFTTREE_CELL, *colorFgSel*. realPos This field is read/only and cannot be set by the application. SetColumns ignores the value in this field. *realPos* is used to convert a [display column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) into a real column number. As a user reorders [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) (see [SetReorderColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_reordercolumns)), the real column number used by an application differs from the display column number. For more information see section "Display vs. Real Columns". dispPos This field specifies the zero-based display position of the column. As a user reorders columns (see SetReorderColumns), the real column number used by an application differs from the display column number. *dispPos *contains the actual (visible) column number the real column represents. For more information see section "Display vs. Real Columns". An application can set this field to 0 (for all columns) so real and display column numbers are identical, otherwise a display column number can be specified for each column. colFlag The column attributes. The following values can be combined: | | | | --- | --- | | SFTTREE_COL_LOCKED | This style causes the column to be a fixed-width column so the user cannot resize it even if [column resizing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_resizing) has been allowed (see [SetResizeHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_resizeheader)). By defining a column as locked and specifying a *width* of 0, a column can be hidden from the user. | | SFTTREE_COL_KEEPPOS | This style causes the column to remain in the current display position even if [column drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_drag_drop) has been defined (see SetReorderColumns). Typically, column 0 could be locked in place, so the user always has the most important data shown first. | | SFTTREE_COL_MERGE | Allows the contents of this column to merge into the next displayed column if the contents of the next cell (or column header) are empty and the next column allows being merged into (SFTTREE_COL_MERGEINTO). This style also applies to column headers. | | SFTTREE_COL_MERGEINTO | Allows the contents of the previous column to merge into this column if the cell (or column header) in this column is empty. This style also applies to column headers. | | SFTTREE_COL_SORTED_ASC | The column header display a [sort indicator](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_sortindicator) representing ascending [sorting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents) if sort indicators are enabled using [EnableSortIndicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enablesortindicators). SFTTREE_COL_SORTED_ASC cannot be used at the same time as SFTTREE_COL_SORTED_DESC. | | SFTTREE_COL_SORTED_DESC | The column header display a sort indicator representing descending sorting if sort indicators are enabled using EnableSortIndicators. SFTTREE_COL_SORTED_DESC cannot be used at the same time as SFTTREE_COL_SORTED_ASC. | minWidth The minimum width of the column (in pixels). Specify a minimum width greater or equal to 0. If a value greater than 0 is specified, the user cannot make this column smaller than the specified value by resizing the column. The *minWidth* value is only used when the user resizes the column. Functions such as [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal) do not take *minWidth* into consideration. If *minWidth* is 0, the column has no minimum width. Picture1 Defines the picture displayed next to the column header. If the *hBmp* member defines a picture*, Picture1* is ignored. flag2, flag4, flag6, flag7 Reserved. Set to 0 when initializing a SFTTREE_COLUMN_EX structure. flag3 Defines default cell attributes for cells in this column. The following values can be combined: | flag3 | Cell attributes | | --- | --- | | 0 | No additional attributes. | | SFTTREE_COL_BGVERTICAL | The default for all background gradient fills of cells in this column is a vertical gradient fill. Cells can override this default using SFTTREE_CELL, *flag3*. | | SFTTREE_COL_BGHORIZONTAL | The default for all background gradient fills of cells in this column is a horizontal gradient fill. Cells can override this default using SFTTREE_CELL, *flag3*. | | SFTTREE_COL_PROGRESSVERTICAL | The default for all [progress bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_progressbar) gradient fills of cells in this column is a vertical gradient fill. Cells can override this default using SFTTREE_CELL, *flag3*. | | SFTTREE_COL_PROGRESSHORIZONTAL | The default for all progress bar gradient fills of cells in this column is a horizontal gradient fill. Cells can override this default using SFTTREE_CELL, *flag3*. | | SFTTREE_COL_PROGRESSFULL | The default for all progress bars in this column is a full size progress bar, using the full height of the cell. | | SFTTREE_COL_PROGRESSSMALL | The default for all progress bars in this column is a vertically centered progress bar, approximately 1/3 of the full height of the cell. | fColorsOverrideTheme Defines whether an application can override [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) and the column header colors are used to render the column header. Set to TRUE to use the defined colors (*headerColorBg*, *headerColorBgSel*, *headerColorBgDisabled*, *headerColorBgSelDisabled*, *headerColorFg*, *headerColorFgSel*, *headerColorFgDisabled*, *headerColorFgSelDisabled*) instead of Windows themes, otherwise set to FALSE. If all colors are set to their default value ([SFTTREE_NOCOLOR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor)), Windows themes are used. headerColorBg The background color used to render this column's header, when Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (defined using [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors), colorColHdrBg). headerColorFg The text color used to render this column's header, when Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (defined using SFTTREE_COLORS, colorColHdrFg). headerColorBgSel The background color used to render this column's header when it is pressed and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (headerColorBg). headerColorFgSel The text color used to render this column's header when it is pressed and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (headerColorFg). headerColorBgDisabled The background color used to render this column's header when it is disabled and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (headerColorBg). headerColorFgDisabled The text color used to render this column's header when it is disabled and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (headerColorFg). headerColorBgSelDisabled The background color used to render this column's header when it is pressed and disabled and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (headerColorBg). headerColorFgSelDisabled The text color used to render this column's header when it is pressed and disabled and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (headerColorFg). colorBgEnd The default ending background color used to draw cells that are not selected. Specify SFTTREE_NOCOLOR to use the default background color. If *colorBg* is not defined, *colorBgEnd* is ignored. Cells can override the default background color using SFTTREE_CELL, *colorBgEnd*. *colorBgEnd* combined with *colorBg* define a gradient fill used to render the cell's background. The default gradient fill orientation can be defined using *flag3*. colorBgSelEnd The default ending background color used to draw cells that are selected. Specify SFTTREE_NOCOLOR to use the default background color. If *colorBgSel* is not defined, *colorBgSelEnd* is ignored. Cells can override the default background color using SFTTREE_CELL, *colorBgSelEnd*. *colorBgEnd* combined with *colorBg* define a gradient fill used to render the cell's background. The default gradient fill orientation can be defined using *flag3*. colorProgress The default color used to draw a progress bar. Specify SFTTREE_NOCOLOR to use the default background color. Cells can override the default background color using SFTTREE_CELL, *colorProgress*. A progress bar is only shown if a cell's SFTTREE_CELL, *progressMax* value has been set to a value greater than 0. colorProgressEnd The default ending color used to draw a progress bar. Specify SFTTREE_NOCOLOR to use the default background color. If *colorProgress* is not defined, *colorProgressEnd* is ignored. Cells can override the default background color using SFTTREE_CELL, *colorProgressEnd*. *colorProgressEnd* combined with *colorProgress* define a gradient fill used to render the progress bar. The default gradient fill orientation can be defined using *flag3*. A progress bar is only shown if a cell's SFTTREE_CELL, *progressMax* value has been set to a value greater than 0. styleFooterTitle The [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) style used for the column footer. If column footer text contains more than one line of text, the [SetMultilineFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_multilinefooter) function must be used. One value of each of the following tables can be combined and assigned to the *styleFooterTitle* member. | styleFooterTitle | Horizontal column footer text alignment | | --- | --- | | *not specified* | If no horizontal column footer text alignment is specified, the default is ES_LEFT. | | ES_LEFT | The column footer text is left aligned within the column footer. | | ES_CENTER | The column footer text is centered within the column footer. | | ES_RIGHT | The column footer is right aligned within the column footer. | | styleFooterTitle | Vertical column footer text alignment | | --- | --- | | *not specified* | If no vertical column footer alignment is specified, the default is SFTTREE_VCENTER. | | SFTTREE_TOP | The column footer text and picture are aligned with the top of the column footer. | | SFTTREE_VCENTER | The column footer text and picture are vertically centered within the column footer. | | SFTTREE_BOTTOM | The column footer text and picture are aligned with the bottom of the column footer. | The *styleFooterTitle* value can optionally be combined with one or more of the following values: | | | | --- | --- | | SFTTREE_HEADER_DISABLED | The column footer for the column is disabled, cannot be clicked and is displayed in a "grayed" fashion. The column contents (cells) are otherwise unaffected. | | SFTTREE_HEADER_UP | The column footer button will automatically return to its "up" position when clicked. | | SFTTREE_HEADER_DROPDOWN | The column footer has a dropdown/filter button rendered as a dropdown button. SFTTREE_HEADER_DROPDOWN cannot be combined with SFTTREE_HEADER_FILTER. | | SFTTREE_HEADER_FILTER | The column footer has a dropdown/filter button rendered as a filter button. SFTTREE_HEADER_FILTER cannot be combined with SFTTREE_HEADER_DROPDOWN. | lpszFooterTitle The column footer title. [Footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footer) text can contain multiple lines of text using cr-lf (\r\n). SetMultilineFooter must be used to enable multiple lines of text. This member may be NULL to indicate that no title is specified for the column. lpszFooterOrig Reserved. Set to NULL when initializing a SFTTREE_COLUMN_EX structure. footerPicture Defines the picture displayed next to the column footer. flagFooter The picture location relative to the column footer text. One value of each of the following tables can be combined and assigned to the *flag* member. | flag | Horizontal column footer picture alignment | | --- | --- | | SFTTREE_BMP_LEFT | The column footer picture is displayed to the left of the cell text. If no horizontal column footer picture alignment value is specified, SFTTREE_BMP_LEFT is assumed. | | SFTTREE_BMP_CENTER | The column footer picture is displayed in the center of the cell, the column footer text is not shown. | | SFTTREE_BMP_RIGHT | The column footer picture is displayed to the right of the column footer text. | | flag | Vertical column footer picture alignment | | --- | --- | | SFTTREE_BMP_VCENTER | The column footer picture is vertically centered within the column footer. If no vertical column footer alignment value is specified, SFTTREE_BMP_VCENTER is assumed. | | SFTTREE_BMP_TOP | The column footer picture is vertically aligned with the top of the column footer. | | SFTTREE_BMP_BOTTOM | The column footer picture is vertically aligned with the bottom of the column footer. | fFooterColorsOverrideTheme Defines whether an application can override Windows themes and the column footer colors are used to render the column footer. Set to TRUE to use the defined colors (*footerColorBg*, *footerColorBgSel*, *footerColorBgDisabled*, *footerColorBgSelDisabled*, *footerColorFg*, *footerColorFgSel*, *footerColorFgDisabled*, *footerColorFgSelDisabled*) instead of Windows themes, otherwise set to FALSE. If all colors are set to their default value (SFTTREE_NOCOLOR), Windows themes are used. footerColorBg The background color used to render this column's footer, when Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (defined using SFTTREE_COLORS, colorColHdrBg). footerColorFg The text color used to render this column's footer, when Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (defined using SFTTREE_COLORS, colorColHdrFg). footerColorBgSel The background color used to render this column's footer when it is pressed and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (footerColorBg). footerColorFgSel The text color used to render this column's footer when it is pressed and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (footerColorFg). footerColorBgDisabled The background color used to render this column's footer when it is disabled and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (footerColorBg). footerColorFgDisabled The text color used to render this column's footer when it is disabled and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (footerColorFg). footerColorBgSelDisabled The background color used to render this column's footer when it is pressed and disabled and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (footerColorBg). footerColorFgSelDisabled The text color used to render this column's footer when it is pressed and disabled and Windows themes are not used or the application can override themes (*fColorsOverrideTheme*). Specify SFTTREE_NOCOLOR to use the default color (footerColorFg). ### Comments The SFTTREE_COLUMN_EX structure is used with GetColumns and SetColumns to retrieve and set column attributes. Due to the variable number of levels and the resulting hierarchical display, the width of the first column is always treated as a minimum width. The text portion of the first column will always be at least of the specified width, no matter what level the item is on. This can result in the first column being much wider than the defined width. Use [GetOverheadWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_overheadwidth) to calculate the actual width of the first column. An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_CONTROL Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_control* The SFTTREE_CONTROL structure is used with [GetControlInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_controlinfo) and SetControlInfo to retrieve and set a tree control's attributes. ``` typedef struct tagSftTreeControl { /* Modifiable fields */ int cbSize; // structure size BOOL fGridHorizontalFull; // full width horizontal lines (when grid lines enabled) BOOL fSelectEnabledItemsOnly; // only enabled items are selectable BOOL fRowColumnHeaderColorsOverrideTheme;// true if the row/column header's colors override Windows themes colors BOOL fRowColumnFooterColorsOverrideTheme;// true if the row/column footer's colors override Windows themes colors int iMouseOverTransitionEffect; // enable expand/collapse button transition effect when the mouse enters/leaves the tree control int nCharSearchMaxInterval; // interval after which search starts over, if there are no characters typed int iFlybyStyle; // Flyby highlighting style #define SFTTREE_FLYBY_NONE 0 #define SFTTREE_FLYBY_COL1 1 #define SFTTREE_FLYBY_ALLCOLUMNS 2 int autoExpandHoverInterval; // 0 or interval after which items are expanded (mouse hover) int toolTipTimeOn; // 0 or interval after which tooltip appears int toolTipTimeOff; // 0 or interval after which tooltip is removed SFT_PICTURE ButtonExpanded; // Expand/collapse button images SFT_PICTURE ButtonCollapsed; SFT_PICTURE ButtonExpandedDown; SFT_PICTURE ButtonCollapsedDown; SFT_PICTURE ButtonExpandedHot; SFT_PICTURE ButtonCollapsedHot; /* read/only fields */ int errorValue; // last GetControlInfo error value } SFTTREE_CONTROL, * LPSFTTREE_CONTROL; typedef const SFTTREE_CONTROL * LPCSFTTREE_CONTROL; ``` ### Members cbSize This field must be set to the SFTTREE_CONTROL structure size before calling GetControlInfo and SetControlInfo otherwise the call will fail. fGridHorizontalFull Defines whether horizontal [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines) extend into the empty area next to the last column. An empty area is only available if the last column is not an [open-ended](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_openended) column. Set to TRUE so grid lines extend into the empty area next to the last column, otherwise FALSE. This value can be modified using SetControlInfo. fSelectEnabledItemsOnly Defines whether only enabled items (see [ItemStatus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemstatus)) can be selected by the end-user. Set to TRUE so only enabled items can be selected by the end-user, otherwise FALSE. This value can be modified using SetControlInfo. An application can always select items, regardless of the settings of *fSelectEnabledItemsOnly*. Functions that are used to return the selected item(s) (like [CurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel), [SelItemRange](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemrange), [SelCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selcount), [SelItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitems), [SelItemsArray](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemsarray)) may include disabled items, even if *fSelectEnabledItemsOnly* is used. The ItemStatus function can be used to test whether an item is enabled. fRowColumnHeaderColorsOverrideTheme Defines whether an application can override [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) and the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) colors are used to render the row/column header. Set to TRUE to use the defined colors ([SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors), colorRowColHdrBg, colorRowColHdrDarkEdge, colorRowColHdrLightEdge) instead of Windows themes, otherwise set to FALSE. If all colors are set to their default value ([SFTTREE_NOCOLOR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor)), Windows themes are used. fRowColumnFooterColorsOverrideTheme Defines whether an application can override Windows themes and the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) colors are used to render the row/column footer. Set to TRUE to use the defined colors (SFTTREE_COLORS, colorRowColFtrBg, colorRowColFtrDarkEdge, colorRowColFtrLightEdge) instead of Windows themes, otherwise set to FALSE. If all colors are set to their default value (SFTTREE_NOCOLOR), Windows themes are used. iMouseOverTransitionEffect Defines whether transition effects for [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) and [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines) are used when the mouse enters/leaves the tree control. Expand/collapse buttons and tree lines must be suitably defined to be visible (using [SetShowButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbuttons), [SetShowButton0](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbutton0) and [SetTreeLineStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_treelinestyle)), otherwise this setting has no effect. A gradual, visual transition is used to show/hide the expand/collapse buttons and tree lines. [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) support is required for transition effects, otherwise *iMouseOverTransitionEffect* is ignored. One value of the following table can be assigned to the *iMouseOverTransitionEffect* member. | iMouseOverTransitionEffect | Transition effect | | --- | --- | | SFTTREE_TRANSITION_NONE | No transition effects are used. | | SFTTREE_TRANSITION_THEMEDVISTAONLY_NOFOCUS | Transition effects are used on Windows Vista (and up) only, when Windows themes are used. When the tree control does not have the input focus and the mouse cursor enters the tree control area, the expand/collapse buttons and tree lines become visible. When the mouse cursor leaves the tree control area, they are hidden. | | SFTTREE_TRANSITION_THEMEDVISTAONLY | Transition effects are used on Windows Vista (and up) only, when Windows themes are used. When the mouse cursor enters the tree control area, the expand/collapse buttons and tree lines become visible. When the mouse cursor leaves the tree control area, they are hidden. | | SFTTREE_TRANSITION_ALWAYS_NOFOCUS | Transition effects are used on all operating systems. When the tree control does not have the input focus and the mouse cursor enters the tree control area, the expand/collapse buttons and tree lines become visible. When the mouse cursor leaves the tree control area, they are hidden. | | SFTTREE_TRANSITION_ALWAYS | Transition effects are used on all operating systems. When the mouse cursor enters the tree control area, the expand/collapse buttons and tree lines become visible. When the mouse cursor leaves the tree control area, they are hidden. | This value can be modified using SetControlInfo. nCharSearchMaxInterval Defines the interval in milliseconds, after which a search starts again if there is no character input. The default is 1000 (1 second). The exact search method is defined using [CharSearchMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_charsearchmode). This value can be modified using SetControlInfo. iFlybyStyle Defines how items are highlighted by [flyby highlighting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_flyby_highlighting). If a selection style is used that uses a rounded outline rectangle with a gradient fill, the [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) is not underlined. Instead, a rounded outline rectangle with a gradient fill is used to highlight the item, based on the current selection style (see [GetSelectionStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle)). One value of the following table can be assigned to *iFlybyStyle*. | iFlybyStyle | Effect | | --- | --- | | SFTTREE_FLYBY_NONE | No flyby highlighting. | | SFTTREE_FLYBY_COL1 | Cell text in the first displayed column is underlined. If a selection style is used that uses a rounded outline rectangle with a gradient fill, the cell text is not underlined. Instead, a rounded outline rectangle with a gradient fill is used to highlight the item, based on the current selection style (see GetSelectionStyle). | | SFTTREE_FLYBY_ALLCOLUMNS | Cell text in all [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) is underlined. If a selection style is used that uses a rounded outline rectangle with a gradient fill, the cell text is not underlined. Instead, a rounded outline rectangle with a gradient fill is used to highlight the item, based on the current selection style (see GetSelectionStyle). | This value can be modified using SetControlInfo. autoExpandHoverInterval Defines the interval in milliseconds, after which a [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) is expanded when [AutoExpand](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_autoexpand) is used. If 0 is specified, the default is 1200 (1.2 seconds). This value can be modified using SetControlInfo. toolTipTimeOn Defines the interval in milliseconds, after which a ToolTip is shown. If 0 is specified, the default is 200 (0.2 seconds). This value can be modified using SetControlInfo. toolTipTimeOff Defines the interval in milliseconds, after which a ToolTip is hidden. If 0 is specified, the default is 100 (0.1 seconds). This value can be modified using SetControlInfo. ButtonExpanded Defines the image used as the expand/collapse button for all expanded parent items. User-defined expand/collapse button images are only used if the [SetButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_buttons)(SFTTREE_BUTTON_USERDEF) is in effect and at least *ButtonExpanded* and *ButtonCollapsed* define valid images. Use [Sft_ClearPicture](https://softelvdm.com/Documentation/SftPicture2/Topic/function_clearpicture) to omit the user-defined button image. This value can be modified using SetControlInfo. ButtonCollapsed Defines the image used as the expand/collapse button for all collapsed parent items. User-defined expand/collapse button images are only used if the SetButtons(SFTTREE_BUTTON_USERDEF) is in effect and at least *ButtonExpanded* and *ButtonCollapsed* define valid images. Use Sft_ClearPicture to omit the user-defined button image. This value can be modified using SetControlInfo. ButtonExpandedDown Defines the image used as the expand/collapse button for expanded parent items, when the button is pressed. User-defined expand/collapse button images are only used if the SetButtons(SFTTREE_BUTTON_USERDEF) is in effect. If *ButtonExpandedDown* doesn't define an image, *ButtonExpanded* is used instead. Use Sft_ClearPicture to omit the user-defined button image. This value can be modified using SetControlInfo. ButtonCollapsedDown Defines the image used as the expand/collapse button for collapsed parent items, when the button is pressed. User-defined expand/collapse button images are only used if the SetButtons(SFTTREE_BUTTON_USERDEF) is in effect. If *ButtonCollapsedDown* doesn't define an image, *ButtonCollapsed* is used instead. Use Sft_ClearPicture to omit the user-defined button image. This value can be modified using SetControlInfo. ButtonExpandedHot Defines the image used as the expand/collapse button for expanded parent items, when the mouse cursor is on the button. User-defined expand/collapse button images are only used if the SetButtons(SFTTREE_BUTTON_USERDEF) is in effect. If *ButtonExpandedHot* doesn't define an image, *ButtonExpanded* is used instead. Use Sft_ClearPicture to omit the user-defined button image. This value can be modified using SetControlInfo. ButtonCollapsedHot Defines the image used as the expand/collapse button for collapsed parent items, when the mouse cursor is on the button. User-defined expand/collapse button images are only used if the SetButtons(SFTTREE_BUTTON_USERDEF) is in effect. If *ButtonCollapsedHot* doesn't define an image, *ButtonCollapsed* is used instead. Use Sft_ClearPicture to omit the user-defined button image. This value can be modified using SetControlInfo. errorValue Read/only. If the SetControlInfo function fails, the *errorValue* member contains an error code, indicating which structure member has caused the failure: | errorValue | Invalid SFTTREE_CONTROL structure member | | --- | --- | | SFTTREE_ERR_iMouseOverTransitionEffect | iMouseOverTransitionEffect | | SFTTREE_ERR_nCharSearchMaxInterval | nCharSearchMaxInterval | | SFTTREE_ERR_iFlybyStyle | iFlybyStyle | | SFTTREE_ERR_autoExpandHoverInterval | autoExpandHoverInterval | | SFTTREE_ERR_toolTipTimeOn | toolTipTimeOn | | SFTTREE_ERR_toolTipTimeOff | toolTipTimeOff | ### Comments The SFTTREE_CONTROL structure is used with GetControlInfo and SetControlInfo to retrieve and set tree control attributes. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_DELETEPARM Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_deleteparm* The SFTTREE_DELETEPARM structure is used to define an application-specific deletion callback routine, which is called whenever an item is removed from the tree control. ``` typedef struct tagSftTreeDeleteParm { SFTTREE_DELETEPROC lpfnDelete; // user supplied deletion callback routine SFTTREE_DWORD_PTR UserData; // user supplied data */ } SFTTREE_DELETEPARM, * LPSFTTREE_DELETEPARM; typedef const SFTTREE_DELETEPARM * LPCSFTTREE_DELETEPARM; ``` ### Members lpfnDelete A pointer to a deletion callback routine, which is called whenever an item is removed from the tree control. UserData An application-specific value. This value is passed to the function *lpfnDelete *[SFTTREE_DELETEPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_deleteproc) as *UserData* parameter. Could be used to pass a global storage area to the callback routine. ### Comments The SFTTREE_DELETEPARM structure is used to define an application-specific deletion callback routine, which is called whenever an item is removed from the tree control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_DELETEPROC Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_deleteproc* Defines the type of a user-supplied callback routine, called by SftTree/DLL whenever an item is removed from the tree control. ``` typedef void (CALLBACK* SFTTREE_DELETEPROC)( HWND hwnd, int index, SFTTREE_DWORD_PTR itemData, SFTTREE_DWORD_PTR UserData); ``` ### Parameters hwnd The window handle of the tree control. index The zero-based index of the item currently being deleted. itemData The application-specific value associated with the item being deleted, set using [SetItemData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata) and SetItemDataPtr. UserData An application-specific value, as supplied in the [SFTTREE_DELETEPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_deleteparm) structure. ### Comments Defines the type of a user-supplied callback routine, called by SftTree/DLL whenever an item is removed from the tree control. A deletion callback is defined using [SetDeleteCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_deletecallback). The callback receives control when an item is about to be deleted. The callback can then perform application specific cleanup processing for the item being deleted. The callback routine is called immediately before the item is deleted. If [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) item data is used, [GetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo) can be used to retrieve the cell information. The callback must not update the tree control in any way. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_DRAGINFO Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_draginfo* The SFTTREE_DRAGINFO structure is used during [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) operations and can be retrieved using [GetDragInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_draginfo). ``` typedef struct tagSftTreeDragInfo { /* read/only fields */ POINT ptDrag; // screen coordinate of mouse cursor HWND hwnd; // window under mouse cursor int index; // current drop entry, -1 if dropped // outside of tree BOOL fLeftTree; // True if left side tree control is drag source BOOL fMultiple; // moving/copying more than one item BOOL fControl; // TRUE if control key pressed BOOL fShift; // TRUE if shift key pressed int button; // button used for dragging #define SFTTREE_LBUTTON 1 #define SFTTREE_MBUTTON 2 #define SFTTREE_RBUTTON 3 /* fields set by application: */ BOOL fDropOK; // set to FALSE if drop not possible HCURSOR hCursor; // application-defined cursor (drag) } SFTTREE_DRAGINFO, * LPSFTTREE_DRAGINFO; ``` ### Members ptDrag Not modifiable. The current screen coordinates of the mouse cursor. hwnd Not modifiable. The handle of the window under the mouse cursor. index Not modifiable. Current entry where items could be dropped. This field may be -1 if the items will be dropped outside the tree control (even in another tree control). fMultiple Not modifiable. TRUE if more than one item is being dragged, otherwise FALSE. fControl Not modifiable. TRUE if the Control key is pressed, otherwise FALSE. fShift Not modifiable. TRUE if the Shift key is pressed, otherwise FALSE. button One of the values SFTTREE_LBUTTON, SFTTREE_MBUTTON or SFTTREE_RBUTTON indicating which button is used for the operation. fDropOK Modifiable. An application can set this to TRUE or FALSE to indicate dropping is currently not possible while processing a [SFTTREEN_BEGINDRAG](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) or SFTTREEN_DRAGGING notification. *fDropOK* has no effect on how SftTree/DLL handles the drag & drop. The field is for use by the application only and is preserved between all drag & drop events. hCursor An application can set the desired mouse cursor while processing a SFTTREEN_BEGINDRAG or SFTTREEN_DRAGGING notification. By default, SftTree/DLL will set a "don't-drop" cursor if dragging outside the current tree control and a simple drop cursor inside the tree control. Implementation of a copy/move cursor based on the number of items or the Control or Shift keys is up to the application. fLeftTree In a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar), *fLeftTree* is set to TRUE if the drag & drop operation started in the left pane, otherwise it is set to FALSE. ### Comments The SFTTREE_DRAGINFO structure is used during drag & drop operations and can be retrieved using GetDragInfo. To find out more about the current drag & drop operation, an application can use GetDragInfo, which makes a pointer to the SFTTREE_DRAGINFO structure available. This area is only valid while processing one WM_COMMAND notification and must be retrieved for each notification. Some of the SFTTREE_DRAGINFO members are modifiable. GetDragInfo should be used when processing SFTTREEN_BEGINDRAG, SFTTREEN_DRAGGING, SFTTREEN_ENDDRAG or SFTTREEN_CANCELDRAG notifications. A tree control must be defined using the [SFTTREESTYLE_DRAGDROP](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_windowstyles) window style to support drag & drop. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## SFTTREE_DRAWINFOPARM Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_drawinfoparm* A drawing information callback is provided for compatibility with earlier releases of SftTree only. A [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) or [SetOwnerDrawCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback) should be used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_DRAWINFOPROC Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_drawinfoproc* A drawing information callback is provided for compatibility with earlier releases of SftTree only. A [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) or [SetOwnerDrawCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback) should be used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_DRAWINGINFO Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_drawinginfo* A drawing information callback is provided for compatibility with earlier releases of SftTree only. A [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) or [SetOwnerDrawCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback) should be used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_DWORD_PTR Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_dword_ptr* Defines a type large enough to hold a DWORD or pointer value. ``` typedef DWORD_PTR SFTTREE_DWORD_PTR; ``` ### Comments SFTTREE_DWORD_PTR defines a type large enough to hold a DWORD or pointer value. On Intel 32-bit platforms (IX86), a DWORD and pointer value have the same size (4 bytes). The SFTTREE_DWORD_PTR type was introduced to support 64-bit platforms, where a DWORD and a pointer do not have the same size. In earlier releases of SftTree/DLL, certain fields were defined using the generic type DWORD. These have been replaced with SFTTREE_DWORD_PTR, where a pointer or DWORD value needs to be saved. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_ID Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_id* Defines the type of an item ID. ``` typedef LPVOID SFTTREE_ID; ``` ### Comments SFTTREE_ID defines the type of an item ID. An item ID describes an item. [Item IDs](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_item_ids) remain constant throughout the lifetime of an item and can be retrieved using [GetItemID](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemid). An item index is typically used with all API functions to manipulate or access an item. Because an item index can change as items are added/deleted, the item ID can be used to uniquely identify an item. An item's item ID remains constant throughout the lifetime of the item. Once the item is removed, the item ID may be reused for a new item that is later added. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_ITEM Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item* The SFTTREE_ITEM structure is used by the callback function SFTTREE_VGETITEM to return the requested item information to SftTree/DLL when a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) is used. ``` typedef struct tagSftTreeITEM { unsigned short level; // item level (0 is highest, no parent) short fShown; // item shown short fEnabled; // item enabled short fFakeExp; // item "fake" expandable short fOpened; // status of item at time of parent close int height; // item height (used by SftTree/DLL, not modifiable) int res1; #if defined(SFTTREE_OBSOLETE_4) HBITMAP hLabel; // not used HBITMAP hItem; // not used #else HBITMAP obsoletehLabel; // OBSOLETE, Bitmap handle for label picture HBITMAP obsoletehItem; // OBSOLETE, Bitmap handle for item picture #endif SFTTREE_DWORD_PTR dwdData; // user data for this item LPSFTTREE_ROW lpRow; // row header info (optional) LPTSTR lpszRowHeader; // row header text LPSFTTREE_CELL aCells; // cell information LPTSTR * alpszString; // array of pointers to strings for each cell (required) SFTTREE_ID key; // item ID DWORD res3, res4, res5; short flag2; // item attributes #define SFTTREEITEM_IGNORE 1 // ignored item (for optimal width calculation) #define SFTTREEITEM_EDITIGNORE 2 // ignored item during cell editing #define SFTTREEITEM_EXPCOLLAPSEBUTTONHIDE 4 // hide expand/collapse button short minHeight; // minimum item height or 0 (variable height only) short maxHeight; // maximum item height or 0 (variable height only) short res4s; // RFFU SFT_PICTURE ItemPicture; // item picture SFT_PICTURE LabelPicture; // label picture // internal only DWORD heightCount; // origin stamp of height (internal use only) BOOL internalSelected; // internal use only } SFTTREE_ITEM, * LPSFTTREE_ITEM; typedef const SFTTREE_ITEM * LPCSFTTREE_ITEM; ``` ### Members level The item's level. This field must be set to 0 and is reserved for future use. fShown The item's [visibility status](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_visibilitystatus). This field must be set to TRUE and is reserved for future use. fEnabled The item's status. This field can be set to TRUE or FALSE (see [GetItemStatus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemstatus)). fFakeExp The item's [expand status](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_expandstatus) (see [GetItemExpandable](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandable)). This field must be set to FALSE and is reserved for future use. fOpened The item's expand status at the time when its [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) was last closed. This field must be set to FALSE and is reserved for future use. height This field must be set to 0 and is reserved for future use. hLabel A bitmap handle defining the [label picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap). Specify NULL to omit the picture. This member is provided for compatibility with older SftTree/DLL versions. The *LabelPicture1* member should be used instead. This member is only accessible if the preprocessor symbol [SFTTREE_OBSOLETE_4](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_obsolete_4) is defined. hItem A bitmap handle defining the [item picture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap). Specify NULL to omit the picture. This member is provided for compatibility with older SftTree/DLL versions. The *LabelPicture1* member should be used instead. This member is only accessible if the preprocessor symbol SFTTREE_OBSOLETE_4 is defined. dwdData An application defined value. This value can be retrieved using [GetItemData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata). SftTree/DLL does not inspect this value in any other way. lpRow A pointer to a [SFTTREE_ROW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_row) structure defining the item's [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers). May be NULL if no row header information needs to be provided (even if row headers are visible). lpszRowHeader A pointer to the text to be used for the item's row header. May be NULL if no row header text needs to be provided (even if row headers are visible). aCells A pointer to [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) structures (one for each column defined in the tree control). May be NULL if no additional [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) information needs to be provided. If a pointer is present it must point to SFTTREE_CELL structures for all defined [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns). The virtual callback function SFTTREE_VGETITEM provides the number of columns in the *totCols* argument. alpszString A pointer to an array of pointers to null-terminated characters. A pointer must be present for each defined columns. The virtual callback function SFTTREE_VGETITEM provides the number of columns in the *totCols* argument. key An application defined key (item ID) for this item. May be 0. This value can be retrieved using [GetItemID](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemid). SftTree/DLL does not inspect this value in any other way. flag2 Item attributes. The following values can be combined: | | | | --- | --- | | 0 | No additional attributes. | | SFTTREEITEM_IGNORE | The item (all cells) is ignored for optimal column width calculation using [MakeColumnOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makecolumnoptimal) and [CalcOptimalColumnWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_calcoptimalcolumnwidth). This attribute is typically used if certain item contents are known to be unusually long, which would make its columns too wide. | | SFTTREEITEM_EDITIGNORE | The item (all cells) is ignored during [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). This attribute can be inspected by an application during cell editing and cell navigation to skip certain non-editable items. While this attribute is not otherwise used by the tree control, it can be used and inspected by the application, simplifying cell editing. | | SFTTREEITEM_EXPCOLLAPSEBUTTONHIDE | Reserved for future use. SftTree/DLL supports "flat" lists only in [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode). Hierarchies cannot be represented in virtual mode. The item's [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) is never shown. This can be useful to suppress an item's expand/collapse button in case an application wants to suppress the display of child items. | minHeight The minimum height of the item in pixels in a [variable height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control. The minimum height overrides the usual item height, which is automatically determined based on item attributes. If this value is 0, no minimum height is defined. This value is ignored in a fixed height tree control, where [SetItemHeightMinMax](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemheightminmax) can be used to define minimum and maximum item heights. maxHeight The maximum height of the item in pixels in a variable height tree control. The maximum height overrides the usual item height, which is automatically determined based on item attributes. If the maximum height is larger than the required height for the item, portions of the item may be vertically clipped. If this value is 0, no maximum height is defined. This value is ignored in a fixed height tree control, where SetItemHeightMinMax can be used to define minimum and maximum item heights. ItemPicture Defines the item picture. If the *hItem* member defines a bitmap*, [ItemPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicture)* is ignored. item pictures are only displayed if the default item pictures have been defined using [SetPictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures). If default item pictures have been defined and *ItemPicture* is empty, the default picture is displayed. LabelPicture Defines the label picture. If the *hLabel* member defines a bitmap*, LabelPicture* is ignored. heightCount This field must be set to 0 and is reserved for internal use. ### Comments The SFTTREE_ITEM structure is used by the callback function SFTTREE_VGETITEM to return the requested item information to SftTree/DLL when a virtual data source is used. All fields marked "reserved for future use" must be initialized to insure compatibility with future releases of SftTree/DLL. The SFTTREE_ITEM structure is used to return item information to SftTree/DLL from the callback function SFTTREE_VGETITEM when a virtual data source is used. All information returned in this structure, including structure referred to by pointers in the SFTTREE_ITEM structure, must remain valid until the SFTTREE_VRELEASEITEM callback function is called by SftTree/DLL. This means that all data must be either in static memory or dynamically allocated. Temporary variables cannot be used to hold information. SftTree/DLL supports "flat" lists only in virtual mode. Hierarchies cannot be represented in virtual mode. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_MAXLEVELS Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_maxlevels* The SFTTREE_MAXLEVELS preprocessor symbol defines the maximum number of levels supported. ``` #define SFTTREE_MAXLEVELS 100 ``` ### Comments The SFTTREE_MAXLEVELS preprocessor symbol defines the maximum number of levels supported. The item level is assigned to each item using the [SetItemLevel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlevel) function. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_NOCOLOR Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor* The SFTTREE_NOCOLOR preprocessor symbol is used to indicate that the default color should be used. ``` #define SFTTREE_NOCOLOR ((COLORREF)(-1)) ``` ### Comments The SFTTREE_NOCOLOR preprocessor symbol is used to indicate that the default color should be used. The SFTTREE_NOCOLOR preprocessor symbol defines a COLORREF color value. This value is typically used if the control's default color or built-in color should be used. An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_OBSOLETE_4 Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_obsolete_4* The SFTTREE_OBSOLETE_4 preprocessor symbol is used to indicate compatibility with SftTree/DLL 4.0 (and older). ``` #define SFTTREE_OBSOLETE_4 ``` ### Comments The SFTTREE_OBSOLETE_4 preprocessor symbol is used to indicate compatibility with SftTree/DLL 4.0 (and older). Starting with SftTree/DLL 4.5, a number of structure members and API functions, which only accepted bitmap handles, have been replaced with the new [SFT_PICTURE](https://softelvdm.com/Documentation/SftPicture2/Topic/struct_sft_picture) type which supports various pictures, such as bitmaps, icons, [GDI+](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_gdiplus) images and ImageLists, etc. If "bitmap only" features are used, compile errors will result, alerting you to the fact that an obsolete feature is used: - [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell) structure - [cell bitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_bitmap) - the hBmp member is now called CellPicture1 - [SFTTREE_ROW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_row) structure - [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) bitmap - the hBmp member is now called RowPicture1 - [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) structure - [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) bitmap - the hBmp member is now called Picture1 - [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) - [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode) - the hLabel and hItem members are now called LabelPicture and [ItemPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itempicture) The preprocessor symbol SFTTREE_OBSOLETE_4 can be used to make these old structure members accessible to applications, so no conversion is required. By defining this symbol (using #define SFTTREE_OBSOLETE_4) these structure members can be used as in earlier releases. At the same time you can also use the new SFT_PICTURE type. Once you are ready to use the new SFT_PICTURE type throughout, simply remove SFTTREE_OBSOLETE_4. At the same time, without defining SFTTREE_OBSOLETE_4, any use of the bitmap members will cause a compile error. While you are encouraged to convert to the new SFT_PICTURE structure, this is not required as long as you define SFTTREE_OBSOLETE_4. For additional information see "[Upgrading from SftTree/DLL 4.0](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_upgrading_from40)". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_OWNERDRAW Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdraw* The SFTTREE_OWNERDRAW structure is used as parameter for an application-supplied owner-draw function of type [LPFNSFTTREE_OWNERDRAWPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_ownerdrawproc), which is called whenever an object needs to be rendered. ``` typedef struct tagSftTreeOwnerDraw { #define SFTTREE_OD_CALC 0 // calculate width & height (returned in DrawRect) #define SFTTREE_OD_PAINT 1 // paint in hDC int style; // callback function int itemType; // item to draw #define SFTTREE_OD_CELL 0 #define SFTTREE_OD_CELLTOOLTIP 1 #define SFTTREE_OD_ROWHEADER 2 #define SFTTREE_OD_COLHEADER 3 #define SFTTREE_OD_COLHEADEREND 4 #define SFTTREE_OD_ROWCOLHEADER 5 #define SFTTREE_OD_ROWCOLFOOTER 6 #define SFTTREE_OD_COLFOOTER 7 #define SFTTREE_OD_COLFOOTEREND 8 HDC hDC; // device context RECT DrawRect; // drawing rectangle int gap; // suggested gap size long index; // entry being painted short col; // column number BOOL fSelected; // non-zero if item selected - paint only BOOL fFlyby; // non-zero if flyby - paint only BOOL fFocus; // non-zero if item has focus rectangle - paint only UINT id; // control's ID HWND hwndCtl; // control's window handle BOOL fEnabled; // non-zero if window is enabled BOOL fThemed; // control is themed HINSTANCE hThemeDLL; // UXTHEME dll handle HANDLE hThemeHeader; // header theme HANDLE hThemeListview; // listview theme HANDLE hThemeTreeview; // treeview theme HANDLE hThemeButton; // button theme HANDLE hThemeCheckBox; // checkbox theme HANDLE hThemeSpin; // spin button theme HANDLE hThemeScrollbar; // scrollbar theme HANDLE hThemeFooter; // footer theme BOOL fDarkMode; // non-zero if dark mode is active int dpi; // effective DPI for this paint (per-monitor v2) BOOL fHighContrast; // non-zero if Windows high-contrast mode is active DWORD res1; } SFTTREE_OWNERDRAW, * LPSFTTREE_OWNERDRAW; typedef const SFTTREE_OWNERDRAW * LPCSFTTREE_OWNERDRAW; ``` ### Members style Identifies the object to render. | | | | --- | --- | | SFTTREE_OD_CALC | The owner-draw callback is called to calculate the dimensions of the object. | | SFTTREE_OD_PAINT | The owner-draw callback is called to paint the object. | itemType Identifies the object. | | | | --- | --- | | SFTTREE_OD_CELL | A [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) - *index* and *col* describe the cell | | SFTTREE_OD_CELLTOOLTIP | A ToolTip - *index* and *col* describe the cell | | SFTTREE_OD_ROWHEADER | A [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) - *index* describes the item | | SFTTREE_OD_COLHEADER | A [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) - *col* describes the column | | SFTTREE_OD_COLHEADEREND | The column header after the end of the last column (fixed-width only) | | SFTTREE_OD_ROWCOLHEADER | The [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header) | | SFTTREE_OD_ROWCOLFOOTER | The [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer) | | SFTTREE_OD_COLFOOTER | The [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) - *col* describes the column | | SFTTREE_OD_COLFOOTEREND | The column footer after the end of the last column (fixed-width only) | hDC The device context. DrawRect Modifiable. If *style* is SFTTREE_OD_CALC, the callback returns the required dimensions in the *DrawRect* rectangle (the width and height are used). If style is SFTTREE_OD_PAINT, *DrawRect* describes the available output area where the object must be rendered. gap A suggested horizontal gap size, usually used between text and pictures or between the edge of the object and text or pictures. index Defines the item. col Defines the column. fSelected TRUE if the object is selected or pressed. fFlyby TRUE if the object should be rendered with [flyby highlighting](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_flyby_highlighting). fFocus TRUE if the tree control has the input focus. id The window ID of the tree control. hwndCtl The window handle of the tree control. fEnabled TRUE if the tree control is enabled. fThemed TRUE if [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) are used to render the tree control. hThemeDLL The module handle of the already loaded Dll UxTheme.dll. This Dll contains all Windows theme rendering support offered by Windows and can be used to dynamically load entry points using GetProcAddress, if desired. If Windows themes are not used, this value is NULL. hThemeHeader An HTHEME handle of theme data for the [Header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_header) class. If Windows themes are not used, this value is NULL. hThemeListview An HTHEME handle of theme data for the ListView class. If Windows themes are not used, this value is NULL. hThemeTreeview An HTHEME handle of theme data for the TreeView class. If Windows themes are not used, this value is NULL. hThemeButton An HTHEME handle of theme data for the Button class. If Windows themes are not used, this value is NULL. hThemeCheckBox An HTHEME handle of theme data for the CheckBox class. If Windows themes are not used, this value is NULL. hThemeSpin An HTHEME handle of theme data for the Spin class. If Windows themes are not used, this value is NULL. hThemeScrollbar An HTHEME handle of theme data for the Scrollbar class. If Windows themes are not used, this value is NULL. hThemeFooter An HTHEME handle of theme data for the Header class. If Windows themes are not used, this value is NULL. Windows does not define a [Footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_footer) class so the Header class is used by default. fDarkMode TRUE if the tree control is currently rendering with the dark color palette. See [SetDarkMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_darkmode). Owner-draw code is responsible for its own dark-mode compliance - the tree control's default render path handles non-owner-drawn areas automatically. dpi The effective DPI (dots-per-inch) for the monitor the tree control is currently displayed on. 96 represents 100% scaling, 144 represents 150%, 192 represents 200%. Owner-draw code should read this value on every paint and must not cache pixel metrics across callbacks. See [GetDPI](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_dpi). fHighContrast TRUE if [Windows High Contrast](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_highcontrast) rendering is currently active on the tree control. See [SetHighContrastMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_highcontrast). Owner-draw code is responsible for its own high contrast compliance - the tree control's default render path remaps colors to system-palette values automatically, but owner-drawn output must do the equivalent remap itself. ### Comments The SFTTREE_OWNERDRAW structure is used as parameter for an application-supplied owner-draw function of type LPFNSFTTREE_OWNERDRAWPROC, which is called whenever an object needs to be rendered. The callback receives control when an object needs to be rendered. The callback can then perform application specific rendering of the object. An application can render cells, cell [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips), row headers, column headers and the row/column header using the owner-draw function. The [SetOwnerDrawCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_ownerdrawcallback) function defines an application-supplied owner-draw function, which is called whenever an object needs to be rendered. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_OWNERDRAWPARM Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_ownerdrawparm* The SFTTREE_OWNERDRAWPARM structure is used to define an application-specific owner-draw callback routine, which is called whenever an object needs to be rendered. ``` typedef struct tagSftTreeOwnerDrawParm { LPFNSFTTREE_OWNERDRAWPROC lpfnOwnerDrawProc; SFTTREE_DWORD_PTR OwnerDrawUserData; } SFTTREE_OWNERDRAWPARM, * LPSFTTREE_OWNERDRAWPARM; typedef const SFTTREE_OWNERDRAWPARM * LPCSFTTREE_OWNERDRAWPARM; ``` ### Members lpfnOwnerDrawProc A pointer to a owner-draw callback routine, which is called every time an object needs to be rendered. OwnerDrawUserData An application-specific value. This value is passed to the function *lpfnOwnerDrawProc** *[LPFNSFTTREE_OWNERDRAWPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_lpfnsfttree_ownerdrawproc) as * OwnerDrawUserData* parameter. Could be used to pass a global storage area to the callback routine. ### Comments The SFTTREE_OWNERDRAWPARM structure is used to define an application-specific owner-draw callback routine, which is called whenever an object needs to be rendered. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_ROW Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_row* The SFTTREE_ROW structure is used with [GetRowInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowinfo) and SetRowInfo and as part of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure (for a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource)). ``` typedef struct tagSftTreeROW { COLORREF colorBg; // row header background color COLORREF colorFg; // row header foreground color COLORREF colorBgSel; // row header background color if selected COLORREF colorFgSel; // row header foreground color if selected #if defined(SFTTREE_OBSOLETE_4) HBITMAP hBmp; // bitmap (NULL if none wanted) #else HBITMAP obsoletehBmp; // bitmap (NULL if none wanted) #endif short flag; // misc. flag short flag2; #define SFTTREE_ROW_COLORSOVERRIDETHEME 0x01 // set if this row header's colors override windows theme colors short res1; // RFFU DWORD res2; // RFFU SFT_PICTURE RowPicture1; // row header picture } SFTTREE_ROW, * LPSFTTREE_ROW; typedef const SFTTREE_ROW * LPCSFTTREE_ROW; ``` ### Members colorBg The background color used to draw the [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) when the item is not selected. Specify [SFTTREE_NOCOLOR](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_nocolor) to use the default background color. colorFg The foreground color used to draw the row header text when the item is not selected. Specify SFTTREE_NOCOLOR to use the default text color. colorBgSel The background color used to draw the row header when the item is selected. Specify SFTTREE_NOCOLOR to use the default background color. colorFgSel The foreground color used to draw the row header text when the item is selected. Specify SFTTREE_NOCOLOR to use the default text color. hBmp The row header picture, displayed next to the row header text. Specify NULL to omit the row header picture. This member is provided for compatibility with older SftTree/DLL versions. The *RowPicture1* member should be used instead. This member is only accessible if the preprocessor symbol [SFTTREE_OBSOLETE_4](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_obsolete_4) is defined. flag The row header text and picture position. This value overrides the default defined using [SetRowHeaderStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderstyle). One value of each of the following tables can be combined and assigned to the *flag* member. | flag | Horizontal row header picture alignment | | --- | --- | | *not specified* | The default alignment value defined using SetRowHeaderStyle applies. | | SFTTREE_BMP_LEFT | The row header picture is displayed to the left of the row header text. | | SFTTREE_BMP_CENTER | The row header picture is displayed in the center of the row header, the row header text is not shown. | | SFTTREE_BMP_RIGHT | The row header picture is displayed to the right of the row header text. | | flag | Vertical row header picture alignment | | --- | --- | | *not specified* | The default alignment value defined using SetRowHeaderStyle applies. | | SFTTREE_BMP_VCENTER | The row header picture is vertically centered within the row header. | | SFTTREE_BMP_TOP | The row header picture is vertically aligned with the top of the row header. | | SFTTREE_BMP_BOTTOM | The row header picture is vertically aligned with the bottom of the row header. | | flag | Horizontal row header text alignment | | --- | --- | | *not specified* | The default alignment value defined using SetRowHeaderStyle applies. | | SFTTREE_TEXT_LEFT | The row header text is left aligned within the row header. | | SFTTREE_TEXT_CENTER | The row header text is centered within the row header. | | SFTTREE_TEXT_RIGHT | The row header text is right aligned within the row header. | | flag | Vertical row header text alignment | | --- | --- | | *not specified* | The default alignment value defined using SetRowHeaderStyle applies. | | SFTTREE_TEXT_TOP | The row header text is aligned with the top of the row header. | | SFTTREE_TEXT_VCENTER | The row header text is vertically centered within the row header. | | SFTTREE_TEXT_BOTTOM | The row header text is aligned with the bottom of the row header. | RowPicture1 Defines the row header picture displayed next to the row header text. If the *hBmp* member defines a bitmap*, RowPicture1* is ignored. flag2 Defines row header attributes. | flag2 | Description | | --- | --- | | 0 | None. | | SFTTREE_ROW_COLORSOVERRIDETHEME | Defines whether an application can override [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes) and the row header colors are used to render the row header. If set, the defined colors (*colorBg*, *colorFg*, *colorBgSel*, *colorFgSel*) are used instead of Windows themes. If all colors are set to their default value (SFTTREE_NOCOLOR), Windows themes are used. | ### Comments The SFTTREE_ROW structure is used with GetRowInfo and SetRowInfo and as part of the SFTTREE_ITEM structure (for a virtual data source). An RGB value or a GetSysColor index value can be specified for all color values. If a color index is used, the high-order bit must be set (e.g., COLOR_WINDOW | 0x80000000L). A row header may have an associated row header picture without the picture actually being visible. The row header picture doesn't become visible until the row header picture size has been registered using SetRowInfo by setting the *index* member of the [SFTTREE_ROWINFOPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_rowinfoparm) structure to -1. Only one picture is used to register the picture size. After registering the picture size, any number of picture may be used. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_fixed_variable_height_items) tree control, all row header picture used for all row headers must be the same size. A new picture size can be registered at any time, but all row header picture in use must be replaced by pictures of the new size. In a variable height tree control, row header pictures can be of varying sizes. The largest picture size must be registered using SetRowInfo. Row header text can be retrieved using [GetRowText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtext) and modified using SetRowText. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_ROWINFOPARM Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_rowinfoparm* The SFTTREE_ROWINFOPARM structure is used as parameter for [GetRowInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowinfo) and SetRowInfo to retrieve and set [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) attributes. ``` typedef struct tagSftTreeRowInfoParm { int version; // structure version (no longer used) int index; // item index SFTTREE_ROW Row; // row header information } SFTTREE_ROWINFOPARM, * LPSFTTREE_ROWINFOPARM; typedef const SFTTREE_ROWINFOPARM * LPCSFTTREE_ROWINFOPARM; ``` ### Members version This member is no longer used and should be set to 0. index An integer value specifying the zero-based index of the item whose attributes are to be set or retrieved. This value can be set to -1 to register a row header picture size. See SetRowInfo for more information. Row The [SFTTREE_ROW](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_row) structure describing the row header of the specified item. ### Comments The SFTTREE_ROWINFOPARM structure is used as parameter for GetRowInfo and SetRowInfo to retrieve and set row header attributes. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_SELENTRY Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_selentry* The SFTTREE_SELENTRY structure is used by [GetSelItemsArray](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemsarray) to return an array of structures describing groups of selected items. ``` typedef struct tagSftTreeSelEntry { int start; // starting entry of selected range int end; // ending entry of selected range } SFTTREE_SELENTRY, * LPSFTTREE_SELENTRY; typedef const SFTTREE_SELENTRY * LPCSFTTREE_SELENTRY; ``` ### Members start The index of the first selected item in the current group described by SFTTREE_SELENTRY. end The index of the last selected item in the current group described by SFTTREE_SELENTRY. This value may be the same as the *start* value, indicating that the current group consists of just one selected item. *end* is guaranteed to be equal to or greater than *start*. ### Comments The SFTTREE_SELENTRY structure is used by GetSelItemsArray to return an array of structures describing groups of selected items. In a [multiple selection](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections) tree control, many discontiguous groups of items may be selected. While [GetSelItems](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitems) returns an index for each selected item, GetSelItemsArray returns an array of groups of selected items. For a large number of selected items this is the preferred method. Note that the array becomes invalid as soon as a selection is changed using API functions or by the user. When using API calls to modify the selected items, the array has to be retrieved again using GetSelItemsArray. The array returned by GetSelItemsArray is read/only and cannot be modified. [SetCurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel), [SetSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sel) and [SelItemRange](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selitemrange) should be used to select or deselect items. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_SORTPROC Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc* The SFTTREE_SORTPROC type is provided for compatibility with earlier releases of SftTree only. [SFTTREE_SORTPROCEX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortprocex) and the appropriate form of the [SortDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents) function should be used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_SORTPROC_CELLDATA Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc_celldata* Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using [SortDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents). ``` typedef int (CALLBACK* SFTTREE_SORTPROC_CELLDATA)( HWND hwnd, LPCTSTR lpszString1, LPCTSTR lpszString2, SFTTREE_DWORD_PTR userData1, SFTTREE_DWORD_PTR userData2, SFTTREE_DWORD_PTR cellData1, SFTTREE_DWORD_PTR cellData2); ``` ### Parameters hwnd The window handle of the tree control. lpszString1 The string component of the first item to sort. This parameter may be NULL if no string component is available (see [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) and [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring)). lpszString2 The string component of the second item to sort. This parameter may be NULL if no string component is available (see AddString and InsertString). userData1 The application-specific value (see [SetItemData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata)) of the first item to sort. userData2 The application-specific value (see SetItemData) of the second item to sort. cellData1 The application-specific value (see [SetCellInfo](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cellinfo)) of the first item to sort. cellData2 The application-specific value (see SetCellInfo) of the second item to sort. ### Returns The return value is 0 if the two items compare as being equal, 1 if the first item is greater than the second item, -1 if the first item is smaller than the second item. ### Comments SFTTREE_SORTPROC_CELLDATA defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents. An application can sort items based on their column contents (*lpszString1* and *lpszString2*), based on item data values (*userData1* and *userData2*) or [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) data values (*cellData1* and *cellData2*). A comparison callback is defined using the SFTTREE_SORTPROC_CELLDATA type. The callback returns 0 if the items compare as being equal, 1 if the first item is greater than the second item, -1 if the first item is smaller than the second item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_SORTPROC_ITEM Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc_item* Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using [SortDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents). ``` typedef int (CALLBACK* SFTTREE_SORTPROC_ITEM)( HWND hwnd, LPCTSTR lpszString1, LPCTSTR lpszString2, LONG index1, LONG index2); ``` ### Parameters hwnd The window handle of the tree control. lpszString1 The string component of the first item to sort. This parameter may be NULL if no string component is available (see [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) and [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring)). lpszString2 The string component of the second item to sort. This parameter may be NULL if no string component is available (see AddString and InsertString). index1 The zero-based item index of the first item to sort. This item index can be used to retrieve item values that are otherwise not accessible. index2 The zero-based item index of the second item to sort. This item index can be used to retrieve item values that are otherwise not accessible. ### Returns The return value is 0 if the two items compare as being equal, 1 if the first item is greater than the second item, -1 if the first item is smaller than the second item. ### Comments SFTTREE_SORTPROC_ITEM defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents. An application can sort items based on their column contents (*lpszString1* and *lpszString2*) or based on other item values, which can be retrieved using the supplied item index values (*index1* and *index**2*). A comparison callback is defined using the SFTTREE_SORTPROC_ITEM type. The callback returns 0 if the items compare as being equal, 1 if the first item is greater than the second item, -1 if the first item is smaller than the second item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_SORTPROCEX Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortprocex* Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using [SortDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents). ``` typedef int (CALLBACK* SFTTREE_SORTPROCEX)( HWND hwnd, LPCTSTR lpszString1, LPCTSTR lpszString2, SFTTREE_DWORD_PTR userData1, SFTTREE_DWORD_PTR userData2); ``` ### Parameters hwnd The window handle of the tree control. lpszString1 The string component of the first item to sort. This parameter may be NULL if no string component is available (see [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) and [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring)). lpszString2 The string component of the second item to sort. This parameter may be NULL if no string component is available (see AddString and InsertString). userData1 The application-specific value (see [SetItemData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemdata)) of the first item to sort. userData2 The application-specific value (see SetItemData) of the second item to sort. ### Returns The return value is 0 if the two items compare as being equal, 1 if the first item is greater than the second item, -1 if the first item is smaller than the second item. ### Comments SFTTREE_SORTPROCEX defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to sort items using SortDependents. An application can sort items based on their column contents (*lpszString1* and *lpszString2*) or based on item data values (*userData1* and *userData2*). A comparison callback is defined using the SFTTREE_SORTPROCEX type. The callback returns 0 if the items compare as being equal, 1 if the first item is greater than the second item, -1 if the first item is smaller than the second item. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_STATIC Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_static* The SFTTREE_STATIC preprocessor symbol defines static [linking](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_buildingapp) of SftTree/DLL to an application. ``` #define SFTTREE_STATIC ``` ### Comments The SFTTREE_STATIC preprocessor symbol defines static linking of SftTree/DLL to an application. It affects the Lib file to be linked with the application. The SFTTREE_STATIC preprocessor symbol should be defined using project settings as shown in section "Building Applications". See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_TOOLTIPSPARM Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_tooltipsparm* The SFTTREE_TOOLTIPSPARM structure is used as parameter for [SetToolTipsCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipscallback), to define an application-specific [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) callback routine, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. ``` typedef struct tagSftTreeToolTipsParm { SFTTREE_TOOLTIPSPROC lpfnToolTips; // user supplied tooltips callback routine SFTTREE_DWORD_PTR UserData; // user supplied data } SFTTREE_TOOLTIPSPARM, * LPSFTTREE_TOOLTIPSPARM; typedef const SFTTREE_TOOLTIPSPARM * LPCSFTTREE_TOOLTIPSPARM; ``` ### Members lpfnToolTips A pointer to a ToolTips callback routine, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. UserData An application-specific value. This value is passed to the function *lpfnToolTips *[SFTTREE_TOOLTIPSPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_tooltipsproc) as *UserData* parameter. Could be used to pass a global storage area to the callback routine.h1 Comments The SFTTREE_TOOLTIPSPARM structure is used as a parameter for SetToolTipsCallback, to define an application-specific ToolTips callback routine, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_TOOLTIPSPROC Type Definition *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_tooltipsproc* Defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to define the ToolTip text when a ToolTip or ScrollTip is to be displayed. ``` typedef void (CALLBACK* SFTTREE_TOOLTIPSPROC)( HWND hwnd, LPTSTR lpszBuffer, // pointer to buffer for tooltip text int type, // type of tooltip to be shown #define SFTTREE_TOOLTIP_VSCROLL 1 // scrolling tooltip #define SFTTREE_TOOLTIP_CELL 2 // cell tooltip #define SFTTREE_TOOLTIP_COLUMN 3 // column header tooltip (replaced by SFTTREE_TOOLTIP_COLUMN_HEADER) #define SFTTREE_TOOLTIP_ROW 4 // row header tooltip #define SFTTREE_TOOLTIP_ROWCOLUMN 5 // row/column header tooltip #define SFTTREE_TOOLTIP_COLUMN_HEADER 3 // column header tooltip #define SFTTREE_TOOLTIP_COLUMN_FOOTER 6 // column footer tooltip int index, // index of cell/row int column, // column # of cell/column SFTTREE_DWORD_PTR UserData, // application-defined data BOOL * lpfInPlace); // set to FALSE for explanatory tooltip ``` ### Parameters hwnd The window handle of the tree control. lpszBuffer A pointer to a 1024 character buffer (including trailing '\0') where the application can store the text for the requested ToolTip or ScrollTip. type Identifies the type of the current ToolTip about to be displayed. Future releases of SftTree/DLL may define additional *type* values. Currently, the following are defined: | | | | --- | --- | | SFTTREE_TOOLTIP_VSCROLL | The user is scrolling vertically. *lpszBuffer* defines the text to be displayed in the ScrollTip. *index* is the item index of the first item currently displayed in the tree control client area. *column* is the column number of the first visible column number (column width is greater than 0). *lpszBuffer* defaults to the contents of the first displayed [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) (item *index*). *lpfInPlace* is ignored by SftTree/DLL. | | SFTTREE_TOOLTIP_CELL | A cell ToolTip is about to be displayed. The ToolTip is displayed for the cell at index *index* and column *column*. *lpszBuffer* defines the text to be displayed and is an empty string by default. If text is copied to *lpszBuffer*, it is displayed as an explanatory ToolTip (*lpfInPlace* is ignored). If *lpszBuffer* is set to an empty string and *lpfInPlace* is set to TRUE, the default cell ToolTip is displayed. If *lpszBuffer* is set to an empty string and *lpfInPlace* is set to FALSE, the ToolTip is completely suppressed. | | SFTTREE_TOOLTIP_COLUMN | Provided for compatibility with older versions - use SFTTREE_TOOLTIP_COLUMN_HEADER instead. | | SFTTREE_TOOLTIP_ROW | Reserved for future use. | | SFTTREE_TOOLTIP_ROWCOLUMN | Reserved for future use. | | SFTTREE_TOOLTIP_COLUMN_HEADER | A [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) ToolTip is about to be displayed for column *column*. *index* is undefined. The text copied to *lpszBuffer* is displayed as an explanatory ToolTip. *lpfInPlace* is ignored by SftTree/DLL. | | SFTTREE_TOOLTIP_COLUMN_FOOTER | A [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) ToolTip is about to be displayed for column *column*. *index* is undefined. The text copied to *lpszBuffer* is displayed as an explanatory ToolTip. *lpfInPlace* is ignored by SftTree/DLL. | index A value specifying the zero-based index of the item for which a ToolTip is about to be displayed (used for SFTTREE_TOOLTIP_CELL and SFTTREE_TOOLTIP_VSCROLL only). column A value specifying the zero-based column number for which a ToolTip is about to be displayed. UserData An application-specific value, as supplied in the [SFTTREE_TOOLTIPSPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_tooltipsparm) structure. lpfInPlace A pointer to a BOOL variable. Only used if a cell ToolTip (SFTTREE_TOOLTIP_CELL) is about to be displayed. Otherwise, *lpfInPlace* has no effect. ### Comments SFTTREE_TOOLTIPSPROC defines the type of a user-supplied callback routine, called by SftTree/DLL to allow an application to define the ToolTip text when a ToolTip or ScrollTip is to be displayed. A [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) callback is defined using [SetToolTipsCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipscallback). The callback receives control when a ToolTip or ScrollTip is about to be displayed. It can determine the text to be displayed by copying it to the buffer *lpszBuffer*. ToolTips are enabled for each column in the [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) structure member *style*. [ScrollTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_scrolltips) are enabled using SetScrollTips. The callback must not update the tree control in any way, but can retrieve tree and item information. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREE_VIRTUALDEF Structure *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_virtualdef* The SFTTREE_VIRTUALDEF structure is used by [VirtualInitialize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualinitialize) to use the tree control in [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode) and to define the [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource). ``` typedef struct tagSftTreeVirtualFuncs { DWORD version; SFTTREE_DWORD_PTR userdataVirtPool; LPFNSFTTREE_VGETITEM lpfnVGetItem; LPFNSFTTREE_VRELEASEITEM lpfnVReleaseItem; LPFNSFTTREE_VGETSTATUS lpfnVGetStatus; LPFNSFTTREE_VSETSTATUS lpfnVSetStatus; LPFNSFTTREE_VINDEXTOVISIBLE lpfnVCvtIndexToVisible; LPFNSFTTREE_VVISIBLETOINDEX lpfnVCvtVisibleToIndex; LPFNSFTTREE_VGETPARENTINDEX lpfnVGetParentIndex; LPFNSFTTREE_VGETNEXTSIBLING lpfnVGetNextSibling; LPFNSFTTREE_VGETPREVSIBLING lpfnVGetPrevSibling; LPFNSFTTREE_VGETFIRSTSIBLING lpfnVGetFirstSibling; LPFNSFTTREE_VGETLASTSIBLING lpfnVGetLastSibling; LPFNSFTTREE_VGETITEM_EX lpfnVGetItemEx; LPFNSFTTREE_VRELEASEITEM_EX lpfnVReleaseItemEx; DWORD res1, res2, res3; DWORD res4, res5, res6; } SFTTREE_VIRTUALDEF, * LPSFTTREE_VIRTUALDEF; typedef const SFTTREE_VIRTUALDEF * LPCSFTTREE_VIRTUALDEF; ``` ### Members version The SftTree/DLL version expected by the application. This value must be set to SFTTREE_VERSION_800, otherwise the call to VirtualInitialize will fail (SFTTREE_VERSION_400, SFTTREE_VERSION_450, SFTTREE_VERSION_500, SFTTREE_VERSION_600, SFTTREE_VERSION_650, SFTTREE_VERSION_700 and SFTTREE_VERSION_750 are still accepted as the current version is upward compatible). This *version* field will be used by future versions of SftTree/DLL to provide upward compatibility for applications designed for earlier versions. userdataVirtPool An application defined value. May be 0. This value is used as *userData* parameter in the callback functions SFTTREE_VGETITEM, SFTTREE_VRELEASEITEM, etc. The value defined here can also be retrieved using [GetVirtualUserData](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualuserdata). lpfnVGetItem A pointer to a callback function SFTTREE_VGETITEM. This function is called by SftTree/DLL to retrieve item information. lpfnVReleaseItem A pointer to a callback function SFTTREE_VRELEASEITEM. This function is called by SftTree/DLL to release item information previously retrieved using SFTTREE_VGETITEM. lpfnVGetStatus, lpfnVSetStatus, lpfnVCvtIndexToVisible, , lpfnVCvtVisibleToIndex, lpfnVGetParentIndex, lpfnVGetNextSibling, lpfnVGetPrevSibling, lpfnVGetFirstSibling, lpfnVGetLastSibling, lpfnVGetItemEx, lpfnVReleaseItemEx, res4, res5, res6 These fields must be set to NULL and are reserved for future use. ### Comments The SFTTREE_VIRTUALDEF structure is used by VirtualInitialize to use the tree control in virtual mode and to define the virtual data source. All fields marked "reserved for future use" must be initialized to 0 or NULL to insure compatibility with future releases of SftTree/DLL. SftTree/DLL supports "flat" lists only in virtual mode. Hierarchies cannot be represented in virtual mode. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SFTTREESPLIT_CLASS Preprocessor Symbol *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttreesplit_class* The SFTTREESPLIT_CLASS preprocessor symbol defines the window class name of a tree control with [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). ``` #define SFTTREESPLIT_CLASS "SftTreeSplit80" ``` ### Comments The SFTTREESPLIT_CLASS preprocessor symbol defines the window class name of a tree control with splitter bar. [SFTTREE_CLASS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/def_sfttree_class) is the window class name of a tree control without splitter bar. The actual class name (SftTreeSplit80) usually changes between SftTree/DLL releases. When defining a tree control using the window class SFTTREESPLIT_CLASS, the functions SftTreeSplit_xxx or the C++ class [CSftTreeSplit](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) must be used. This preprocessor symbol is normally used when creating a control window dynamically using CreateWindow(Ex). When designing a dialog resource (see "[Creating a Dialog Resource](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_vc)"), the window class name must be entered as-is and the preprocessor symbol cannot be used. See Also C/C++ API | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Show3D *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_show3d* Defines the current display method used for items. C ``` BOOL WINAPI SftTree_GetShow3D(HWND hwndCtl); void WINAPI SftTree_SetShow3D(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShow3D(HWND hwndCtl); void WINAPI SftTreeSplit_SetShow3D(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShow3D() const; void CSftTree::SetShow3D(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetShow3D() const; void CSftTreeSplit::SetShow3D(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display items in 3D mode, otherwise set to FALSE to use standard window colors. ### Returns GetShow3D returns a value indicating the current display mode of items. TRUE is returned if 3D rendering of items is in effect, FALSE is returned if items are drawn using standard window colors. ### Comments The GetShow3D and SetShow3D functions define the current display method used for items. When using the 3D display mode (enabled using SetShow3D), only [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) or the text in the first cell is highlighted (see [SetSelectionStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_selectionstyle)). When using the 3D display mode and [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines) are enabled, only vertical grid lines are shown. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowBitmaps *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbitmaps* Returns a value indicating the presence of [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap). C ``` BOOL WINAPI SftTree_GetShowBitmaps(HWND hwndCtl); BOOL WINAPI SftTreeSplit_GetShowBitmaps(HWND hwndCtl); ``` C++ ``` BOOL CSftTree::GetShowBitmaps() const; BOOL CSftTreeSplit::GetShowBitmaps() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value indicates whether item pictures are currently shown. TRUE is returned if item pictures are shown, otherwise FALSE is returned. ### Comments The GetShowBitmaps function returns a value indicating the presence of item pictures. Item pictures are only shown once they are enabled using [SetPictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pictures). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowButton0 *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbutton0* Defines the presence of level 0 [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons). C ``` BOOL WINAPI SftTree_GetShowButton0(HWND hwndCtl); void WINAPI SftTree_SetShowButton0(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowButton0(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowButton0(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowButton0() const; void CSftTree::SetShowButton0(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetShowButton0() const; void CSftTreeSplit::SetShowButton0(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display expand/collapse buttons for items on level 0, otherwise set to FALSE. ### Returns GetShowButton0 returns a value indicating whether expand/collapse buttons for items on level 0 are shown. TRUE is returned if level 0 expand/collapse buttons are shown, otherwise FALSE is returned. ### Comments The GetShowButton0 and SetShowButton0 functions define the presence of level 0 expand/collapse buttons. [SetShowButtons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbuttons) can be used to enable or disable expand/collapse buttons on levels other than level 0. The [SetItemExpandCollapseButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandcollapsebutton) function can be used to hide an item's expand/collapse button. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowButtons *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbuttons* Defines the presence of [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) (other than level 0). C ``` BOOL WINAPI SftTree_GetShowButtons(HWND hwndCtl); void WINAPI SftTree_SetShowButtons(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowButtons(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowButtons(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowButtons() const; void CSftTree::SetShowButtons(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetShowButtons() const; void CSftTreeSplit::SetShowButtons(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display expand/collapse buttons for all items (except items on level 0), otherwise set to FALSE. ### Returns GetShowButtons returns a value indicating whether expand/collapse buttons for items on all levels except level 0 are shown. TRUE is returned if expand/collapse buttons are shown, otherwise FALSE is returned. ### Comments The GetShowButtons and SetShowButtons functions define the presence of expand/collapse buttons (other than level 0). [SetShowButton0](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showbutton0) can be used to enable or disable expand/collapse buttons on level 0. The [SetItemExpandCollapseButton](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemexpandcollapsebutton) function can be used to hide an item's expand/collapse button. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowFocus *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfocus* Defines whether a focus rectangle is drawn around the current item when the tree control has the input focus. C ``` BOOL WINAPI SftTree_GetShowFocus(HWND hwndCtl); void WINAPI SftTree_SetShowFocus(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowFocus(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowFocus(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowFocus() const; void CSftTree::SetShowFocus(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetShowFocus() const; void CSftTreeSplit::SetShowFocus(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display the focus rectangle, otherwise set to FALSE. ### Returns GetShowFocus returns a value indicating whether a focus rectangle is drawn around the current item when the tree control has the input focus. TRUE is returned if the focus rectangle is drawn, otherwise FALSE is returned. ### Comments The GetShowFocus and SetShowFocus functions define whether a focus rectangle is drawn around the current item when the tree control has the input focus. The focus rectangle is used to indicate to the user which item is the current item (see [GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex)). An application could turn off the focus rectangle to change the display style of the current item by using [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) foreground and background colors instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowFooter *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter* Defines the presence of [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers). C ``` BOOL WINAPI SftTree_GetShowFooter(HWND hwndCtl); void WINAPI SftTree_SetShowFooter(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowFooter(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowFooter(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowFooter() const; BOOL CSftTreeSplit::GetShowFooter() const; void CSftTree::SetShowFooter(BOOL fSet = TRUE); void CSftTreeSplit::SetShowFooter(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to make footers visible, otherwise set to FALSE to hide footers. ### Returns GetShowFooter returns a value indicating whether column footers are shown. TRUE is returned if column footers are shown, otherwise FALSE is returned. ### Comments The GetShowFooter and SetShowFooter functions define the presence of column footers. Column footer attributes can be manipulated using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowFooterButtons *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooterbuttons* Defines the presence of [column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) buttons. C ``` BOOL WINAPI SftTree_GetShowFooterButtons(HWND hwndCtl); void WINAPI SftTree_SetShowFooterButtons(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowFooterButtons(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowFooterButtons(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowFooterButtons() const; void CSftTree::SetShowFooterButtons(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetShowFooterButtons() const; void CSftTreeSplit::SetShowFooterButtons(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display footers as buttons, set to FALSE to display footers as titles. ### Returns GetShowFooterButtons may return TRUE even if footers are not displayed. In that case, the return value indicates the current settings which will take effect once the footers are shown (see [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). ### Comments The GetShowFooterButtons and SetShowFooterButtons functions define the presence of column footer buttons. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowGrid *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showgrid* Defines the presence of [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines). C ``` BOOL WINAPI SftTree_GetShowGrid(HWND hwndCtl); void WINAPI SftTree_SetShowGrid(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowGrid(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowGrid(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowGrid() const; BOOL CSftTreeSplit::GetShowGrid() const; void CSftTree::SetShowGrid(BOOL fSet = TRUE); void CSftTreeSplit::SetShowGrid(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display grid lines, otherwise set to FALSE. ### Returns GetShowGrid returns a value indicating whether grid lines are shown. TRUE is returned if grid lines are shown, otherwise FALSE is returned. ### Comments The GetShowGrid and SetShowGrid functions define the presence of grid lines. When using the 3D display mode (enabled using [SetShow3D](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_show3d)), only vertical grid lines are shown. Vertical and horizontal grid lines can be controlled using [SetGridStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_gridstyle). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowHeader *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader* Defines the presence of [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers). C ``` BOOL WINAPI SftTree_GetShowHeader(HWND hwndCtl); void WINAPI SftTree_SetShowHeader(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowHeader(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowHeader(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowHeader() const; BOOL CSftTreeSplit::GetShowHeader() const; void CSftTree::SetShowHeader(BOOL fSet = TRUE); void CSftTreeSplit::SetShowHeader(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to make headers visible, otherwise set to FALSE to hide headers. ### Returns GetShowHeader returns a value indicating whether column headers are shown. TRUE is returned if column headers are shown, otherwise FALSE is returned. ### Comments The GetShowHeader and SetShowHeader functions define the presence of column headers. Column header attributes can be manipulated using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowHeaderButtons *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheaderbuttons* Defines the presence of [column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) buttons. C ``` BOOL WINAPI SftTree_GetShowHeaderButtons(HWND hwndCtl); void WINAPI SftTree_SetShowHeaderButtons(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowHeaderButtons(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowHeaderButtons(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowHeaderButtons() const; void CSftTree::SetShowHeaderButtons(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetShowHeaderButtons() const; void CSftTreeSplit::SetShowHeaderButtons(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display headers as buttons, set to FALSE to display headers as titles. ### Returns GetShowHeaderButtons may return TRUE even if headers are not displayed. In that case, the return value indicates the current settings which will take effect once the headers are shown (see [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). ### Comments The GetShowHeaderButtons and SetShowHeaderButtons functions define the presence of column header buttons. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowLabels *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showlabels* Returns the presence of [label pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap). C ``` BOOL WINAPI SftTree_GetShowLabels(HWND hwndCtl); BOOL WINAPI SftTreeSplit_GetShowLabels(HWND hwndCtl); ``` C++ ``` BOOL CSftTree::GetShowLabels() const; BOOL CSftTreeSplit::GetShowLabels() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value indicates whether label pictures are currently shown. TRUE is returned if label pictures are shown, otherwise FALSE is returned. ### Comments The GetShowLabels function returns the presence of label pictures. Label pictures are only shown once the picture size is registered using [SetItemLabelPicture](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlabelpicture). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowPlusMinus *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showplusminus* Returns the presence of [plus/minus bitmaps](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_plusminus_bitmap). C ``` BOOL WINAPI SftTree_GetShowPlusMinus(HWND hwndCtl); BOOL WINAPI SftTreeSplit_GetShowPlusMinus(HWND hwndCtl); ``` C++ ``` BOOL CSftTree::GetShowPlusMinus() const; BOOL CSftTreeSplit::GetShowPlusMinus() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns The return value indicates whether plus/minus bitmaps are currently shown. TRUE is returned if plus/minus bitmaps are shown, otherwise FALSE is returned. ### Comments The GetShowPlusMinus function returns the presence of plus/minus bitmaps. Plus/minus bitmaps are only shown once the bitmaps are registered using [SetPlusMinus](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_plusminus). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowRowColFooterButton *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowcolfooterbutton* Defines the [row/column footer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_footer)'s display style. C ``` BOOL WINAPI SftTree_GetShowRowColFooterButton(HWND hwndCtl); void WINAPI SftTree_SetShowRowColFooterButton(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowRowColFooterButton(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowRowColFooterButton(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowRowColFooterButton() const; void CSftTree::SetShowRowColFooterButton(BOOL fSet); BOOL CSftTreeSplit::GetShowRowColFooterButton() const; void CSftTreeSplit::SetShowRowColFooterButton(BOOL fSet); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display the row/column footer as a button, set to FALSE to display it as a title. ### Returns GetShowRowColFooterButton returns TRUE if the row/column footer is displayed as a button, FALSE otherwise. ### Comments The GetShowRowColFooterButton and SetShowRowColFooterButton functions define the row/column footer's display style. The row/column footer area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column footers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_footers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowFooter](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showfooter)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowRowColHeaderButton *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowcolheaderbutton* Defines the [row/column header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_row_column_header)'s display style. C ``` BOOL WINAPI SftTree_GetShowRowColHeaderButton(HWND hwndCtl); void WINAPI SftTree_SetShowRowColHeaderButton(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowRowColHeaderButton(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowRowColHeaderButton(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowRowColHeaderButton() const; void CSftTree::SetShowRowColHeaderButton(BOOL fSet); BOOL CSftTreeSplit::GetShowRowColHeaderButton() const; void CSftTreeSplit::SetShowRowColHeaderButton(BOOL fSet); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display the row/column header as a button, set to FALSE to display it as a title. ### Returns GetShowRowColHeaderButton returns TRUE if the row/column header is displayed as a button, FALSE otherwise. ### Comments The GetShowRowColHeaderButton and SetShowRowColHeaderButton functions define the row/column header's display style. The row/column header area is only shown if [row headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) and [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are both shown (see [SetShowRowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader) and [SetShowHeader](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showheader)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowRowHeader *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showrowheader* Defines the [row header](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_row_headers) display style. C ``` int WINAPI SftTree_GetShowRowHeader(HWND hwndCtl); void WINAPI SftTree_SetShowRowHeader(HWND hwndCtl, int style); int WINAPI SftTreeSplit_GetShowRowHeader(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowRowHeader(HWND hwndCtl, int style); ``` C++ ``` int CSftTree::GetShowRowHeader() const; void CSftTree::SetShowRowHeader(int style); int CSftTreeSplit::GetShowRowHeader() const; void CSftTreeSplit::SetShowRowHeader(int style); ``` ### Parameters hwndCtl The window handle of the tree control. style A value describing the row header display style: | | | | --- | --- | | SFTTREE_ROWSTYLE_NONE | No row headers. | | SFTTREE_ROWSTYLE_BUTTONTEXT | Displays row headers as buttons. No default text. | | SFTTREE_ROWSTYLE_TITLETEXT | Displays row headers as titles. No default text. | | SFTTREE_ROWSTYLE_BUTTONCOUNT0 | Displays row headers as buttons. The row header text defaults to the zero-based index of the item and can be specified using [SetRowText](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowtext). | | SFTTREE_ROWSTYLE_TITLECOUNT0 | Displays row headers as titles. The row header text defaults to the zero-based index of the item and can be specified using SetRowText. | | SFTTREE_ROWSTYLE_BUTTONCOUNT1 | Displays row headers as buttons. The row header text defaults to the one-based index of the item and can be specified using SetRowText. | | SFTTREE_ROWSTYLE_TITLECOUNT1 | Displays row headers as buttons. The row header text defaults to the one-based index of the item and can be specified using SetRowText. | ### Returns GetShowRowHeader returns a value describing the current row header style. ### Comments The GetShowRowHeader and SetShowRowHeader functions define the row header display style. If the current style is set to SFTTREE_ROWSTYLE_BUTTONTEXT, SFTTREE_ROWSTYLE_BUTTONCOUNT0 or SFTTREE_ROWSTYLE_BUTTONCOUNT1, the row headers are displayed as buttons, which can be clicked by the user. Row header buttons reflect the selection status (See [GetSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sel) and [GetCurSel](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_cursel)) of each item. The value defined using SetShowRowHeader applies to all row headers and cannot be changed for individual items. The status of the row header buttons can be controlled using [SetRowHeaderStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_rowheaderstyle). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowTreeLines *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showtreelines* ShowTreeLines is provided for compatibility with SftTree/DLL 2.0 (and earlier) only. Applications should use the [SetTreeLineStyle](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_treelinestyle) function instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ShowTruncated *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showtruncated* Defines whether text is clipped or truncated using trailing "...". C ``` BOOL WINAPI SftTree_GetShowTruncated(HWND hwndCtl); void WINAPI SftTree_SetShowTruncated(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetShowTruncated(HWND hwndCtl); void WINAPI SftTreeSplit_SetShowTruncated(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetShowTruncated() const; void CSftTree::SetShowTruncated(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetShowTruncated() const; void CSftTreeSplit::SetShowTruncated(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display truncated text using trailing "...", otherwise set to FALSE. ### Returns GetShowTruncated returns TRUE if text is clipped or truncated using trailing "...", otherwise FALSE is returned. ### Comments The GetShowTruncated and SetShowTruncated functions define whether text is clipped or truncated using trailing "...". The display method defined using SetShowTruncated applies to all text components in a tree control. By setting it to TRUE, text that is too large (horizontally) to fit in the space allocated will be truncated by showing trailing periods ("..."). If set to FALSE, text will be clipped if too large and displayed in the available area. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## Sibling *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sibling* Returns an item's [sibling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_siblings) information. C ``` int WINAPI SftTree_GetSibling(HWND hwndCtl, int index, int type); int WINAPI SftTreeSplit_GetSibling(HWND hwndCtl, int index, int type); ``` C++ ``` int CSftTree::GetSibling(int index, int type) const; int CSftTreeSplit::GetSibling(int index, int type) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index number of the item for which sibling item information is to be retrieved. type A value indicating the type of sibling item information to retrieve. | | | | --- | --- | | SFTTREE_SIBLING_FIRST | Retrieve the index of the item's first sibling. | | SFTTREE_SIBLING_LAST | Retrieve the index of the item's last sibling. | | SFTTREE_SIBLING_PREV | Retrieve the index of the item's previous sibling. | | SFTTREE_SIBLING_NEXT | Retrieve the index of the item's next sibling. | ### Returns The return value is the index of the requested sibling item or -1 if the specified item doesn't have a sibling of the specified type. ### Comments The GetSibling function returns an item's sibling information. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SizeBox *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sizebox* Defines whether a size box is shown in the tree control's lower-right corner so the user can resize the control by dragging it. C ``` BOOL WINAPI SftTree_GetSizeBox(HWND hwndCtl); BOOL WINAPI SftTree_GetSizeBoxActive(HWND hwndCtl); void WINAPI SftTree_SetSizeBox(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetSizeBox(HWND hwndCtl); BOOL WINAPI SftTreeSplit_GetSizeBoxActive(HWND hwndCtl); void WINAPI SftTreeSplit_SetSizeBox(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetSizeBox() const; BOOL CSftTree::GetSizeBoxActive() const; void CSftTree::SetSizeBox(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetSizeBox() const; BOOL CSftTreeSplit::GetSizeBoxActive() const; void CSftTreeSplit::SetSizeBox(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet TRUE to show a size box in the tree control's lower-right corner, FALSE to suppress it. ### Returns GetSizeBox returns TRUE if a size box is shown, otherwise FALSE. GetSizeBoxActive returns TRUE while the user is actively dragging the size box to resize the control, otherwise FALSE. SetSizeBox has no return value. ### Comments The GetSizeBox and SetSizeBox functions control whether a size box is shown in the tree control's lower-right corner. The size box is a small grip the user can drag to resize the tree control. The size box is only useful when the tree control is used as a stand-alone window, for example as a drop-down window the user can resize. When the tree control is embedded in a dialog or another window, its size is controlled by the parent window, so the size box cannot be used. The size box is hidden by default. GetSizeBoxActive can be polled to detect whether the user is currently dragging the size box. This is useful when the application needs to suppress operations (e.g., layout updates) for the duration of an interactive resize. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SortColumn1 *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortcolumn1* Returns information about the currently sorted column. C ``` BOOL WINAPI SftTree_GetSortColumn1(HWND hwndCtl, int* realCol, int* sortStyle); BOOL WINAPI SftTreeSplit_GetSortColumn1(HWND hwndCtl, int* realCol, int* sortStyle); ``` C++ ``` BOOL CSftTree::GetSortColumn1(int& sortCol, BOOL& ascending); BOOL CSftTreeSplit::GetSortColumn1(int& sortCol, BOOL& ascending); ``` ### Parameters hwndCtl The window handle of the tree control. realCol A pointer to a field *realCol* (C) or the reference *sortCol* (C++) where the [real column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) of the currently sorted column is returned. The value -1 is returned if no column has a [sort indicator](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_sortindicator). sortStyle (C) A pointer to a field where the sort style of the currently sorted column is returned (see the table below). In C++ the corresponding parameter is the reference *ascending*, which is set to TRUE if the sorted column is in ascending order, FALSE if it is in descending order. | | | | --- | --- | | Value | Description | | SFTTREE_SORT_ASC | The sort indicator is shown as "ascending sort". | | SFTTREE_SORT_DESC | The sort indicator is shown as "descending sort". | ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetSortColumn1 function returns information about the currently sorted column. Only one column can be sorted ascending or descending at a time using the built-in sort handling using [EnableSortIndicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enablesortindicators) with *fAuto* set to TRUE. The GetSortColumn1 function is typically used when the [SFTTREEN_LBUTTONDBLCLK_COLUMN_HEADER](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification is received to retrieve the currently sorted column and its sort order so the application can sort the items using a call to the [SortDependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents) function. The EnableSortIndicators function is used to enable sort indicators in [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## SortDependents *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortdependents* Sorts items. C ``` BOOL WINAPI SftTree_SortDependentsEx(HWND hwndCtl, int index, SFTTREE_SORTPROCEX lpfnCompareEx); BOOL SftTree_SortColDependentsEx(HWND hwndCtl, int index, int realCol, SFTTREE_SORTPROCEX lpfnCompareEx); BOOL WINAPI SftTree_SortDependentsCellData(HWND hwndCtl, int index, int realCol, SFTTREE_SORTPROC_CELLDATA lpfnCompareCellData); BOOL WINAPI SftTree_SortDependentsItem(HWND hwndCtl, int index, int realCol, SFTTREE_SORTPROC_ITEM lpfnCompareItem); BOOL WINAPI SftTreeSplit_SortDependentsEx(HWND hwndCtl, int index, SFTTREE_SORTPROCEX lpfnCompareEx); BOOL SftTreeSplit_SortColDependentsEx(HWND hwndCtl, int index, int realCol, SFTTREE_SORTPROCEX lpfnCompareEx); BOOL WINAPI SftTreeSplit_SortDependentsCellData(HWND hwndCtl, int index, int realCol, SFTTREE_SORTPROC_CELLDATA lpfnCompareCellData); BOOL WINAPI SftTreeSplit_SortDependentsItem(HWND hwndCtl, int index, int realCol, SFTTREE_SORTPROC_ITEM lpfnCompareItem); ``` C++ ``` BOOL CSftTree::SortDependents(int index, SFTTREE_SORTPROCEX lpfnCompareEx); BOOL CSftTree::SortDependents(int index, int realCol, SFTTREE_SORTPROC_CELLDATA lpfnCompareCellData); BOOL CSftTree::SortDependents(int index, int realCol, SFTTREE_SORTPROCEX lpfnCompareEx); BOOL CSftTree::SortDependents(int index, int realCol, SFTTREE_SORTPROC_ITEM lpfnCompareItem); BOOL CSftTreeSplit::SortDependents(int index, SFTTREE_SORTPROCEX lpfnCompareEx); BOOL CSftTreeSplit::SortDependents(int index, int realCol, SFTTREE_SORTPROC_CELLDATA lpfnCompareCellData); BOOL CSftTreeSplit::SortDependents(int index, int realCol, SFTTREE_SORTPROCEX lpfnCompareEx); BOOL CSftTreeSplit::SortDependents(int index, int realCol, SFTTREE_SORTPROC_ITEM lpfnCompareItem); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item whose immediate [dependents](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_dependents) will be sorted. This parameter can be -1, in which case all items at the [root level](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_rootlevel) (level 0) are sorted. realCol The zero-based column number whose text is to be sorted. lpfnCompareEx A pointer to a string comparison callback routine of type [SFTTREE_SORTPROCEX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortprocex). This parameter may be NULL, in which case items are sorted in ascending fashion. lpfnCompareCellData A pointer to a string comparison callback routine of type [SFTTREE_SORTPROC_CELLDATA](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc_celldata). This parameter may be NULL, in which case items are sorted in ascending fashion. lpfnCompareItem A pointer to a string comparison callback routine of type [SFTTREE_SORTPROC_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc_item). This parameter may be NULL, in which case items are sorted in ascending fashion. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SortDependents functions sort items. The column text sorted is based on the column specified using *realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the *realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. When sorting dependents, only immediate dependents are sorted, i.e. items on the immediate lower level. Dependents of items being sorted are moved with their [parent item](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent), but are not sorted. Use a separate SortDependents call for each parent item to be sorted. The sorting algorithm used preserves the order of an already sorted list, when many items have identical keys. This allows multiple [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) to be sorted by sorting the least significant column first and the most significant column last. If an application doesn't add [tree items](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_items) with a string component for the column being sorted, but uses the (obsolete) [DrawInfoCallback](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_drawinfocallback) drawing callback routine to supply strings when items are painted, this function can only be used to sort items by item data values. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), sorting functions cannot be used and an error is returned. The external virtual data source should be sorted instead. > Additional forms of the SortDependents functions exist, which use a [SFTTREE_SORTPROC](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/typedef_sfttree_sortproc) callback, but are only provided for compatibility with earlier versions of SftTree/DLL and are not documented. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SortIndicator *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_sortindicator* Defines the sort information for the specified [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns). C ``` BOOL WINAPI SftTree_GetSortIndicator(HWND hwndCtl, int realCol, int* sortStyle); BOOL WINAPI SftTree_SetSortIndicator(HWND hwndCtl, int realCol, int sortStyle); BOOL WINAPI SftTreeSplit_GetSortIndicator(HWND hwndCtl, int realCol, int* sortStyle); BOOL WINAPI SftTreeSplit_SetSortIndicator(HWND hwndCtl, int realCol, int sortStyle); ``` C++ ``` BOOL CSftTree::GetSortIndicator(int realCol, int* sortStyle); BOOL CSftTree::SetSortIndicator(int realCol, int sortStyle); BOOL CSftTreeSplit::GetSortIndicator(int realCol, int* sortStyle); BOOL CSftTreeSplit::SetSortIndicator(int realCol, int sortStyle); ``` ### Parameters hwndCtl The window handle of the tree control. realCol The [real column number](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_display_vs_real_column) for which the sort style is returned. sortStyle A pointer to a field where the sort style of the specified column *realCol* is returned (GetSortIndicator) or the new sort style to be defined for the specified column (SetSortIndicator). | | | | --- | --- | | Value | Description | | SFTTREE_SORT_NONE | There is no [sort indicator](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_sortindicator) for the specified column *realCol*. | | SFTTREE_SORT_ASC | The sort indicator is shown as "ascending sort". | | SFTTREE_SORT_DESC | The sort indicator is shown as "descending sort". | ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SortIndicator function defines the sort information for the specified column *realCol*. Only one column can be sorted ascending or descending at a time using the built-in sort handling using [EnableSortIndicators](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enablesortindicators) with *fAuto* set to TRUE. If the application explicitly defines sort indicators using the SortIndicator function, multiple columns can have sort indicators. The ResetSortIndicator function can be used to clear all columns' sort indicators. The EnableSortIndicators function is used to enable sort indicators in [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SplitColumn *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitcolumn* Defines the number of [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) displayed in the left pane of a [split tree control](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar). C ``` int WINAPI SftTreeSplit_GetSplitColumn(HWND hwndCtl); BOOL WINAPI SftTreeSplit_SetSplitColumn(HWND hwndCtl, int splitColumn); ``` C++ ``` int CSftTreeSplit::GetSplitColumn() const; BOOL CSftTreeSplit::SetSplitColumn(int splitColumn); ``` ### Parameters hwndCtl The window handle of the tree control. splitColumn The number of columns displayed in the left pane of a split tree control. The number specified must be between 1 and the total number of columns - 1. The total number of columns is defined using [SetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns). ### Returns GetSplitColumn returns the number of columns displayed in the left pane. ### Comments The GetSplitColumn and SetSplitColumn functions define the number of columns displayed in the left pane of a split tree control. GetSplitColumn and SetSplitColumn are only available for a split tree control. A splitter bar is always present in a split tree control, it cannot be removed. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SplitterOffset *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffset* Defines the offset of the [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) relative to the left edge of the tree control's client area. C ``` void WINAPI SftTreeSplit_SetSplitterOffset(HWND hwndCtl, int offset); ``` C++ ``` void CSftTreeSplit::SetSplitterOffset(int offset); ``` ### Parameters hwndCtl The window handle of the tree control. offset A value defining the offset of the splitter bar relative to the left edge of the tree control's client area (in pixels). If -1 is specified, the splitter bar is centered in the tree control's client area making each pane the same size. If the offset falls outside of the client area, the splitter bar is aligned with the left or right edge, whichever is closer to the *offset* specified. ### Comments The GetSplitterOffset and SetSplitterOffset functions define the offset of the splitter bar relative to the left edge of the tree control's client area. SetSplitterOffset is only available for a split tree control. [MakeSplitterOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makesplitteroptimal) can be used to position the splitter bar optimally, so the left pane can display as much data as possible without a horizontal scroll bar. The coordinates of the splitter bar can be retrieved using [GetSplitterRect](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterrect). [SetSplitterWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterwidth) is used to change the width of the splitter bar. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SplitterOffsetMin *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffsetmin* Defines a minimum [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) offset to prevent the user from hiding the left pane of a split tree control. C ``` void WINAPI SftTreeSplit_SetSplitterOffsetMin(HWND hwndCtl, int minOffset); int WINAPI SftTreeSplit_GetSplitterOffsetMin(HWND hwndCtl); ``` C++ ``` void CSftTreeSplit::SetSplitterOffsetMin(int minOffset); int CSftTreeSplit::GetSplitterOffsetMin() const; ``` ### Parameters hwndCtl The window handle of the tree control. minOffset The minimum splitter bar offset in caller-reference (96-DPI) pixels, measured from the left edge of the tree control's client area. A value of 0 (the default) preserves the traditional no-floor behavior, allowing the user to drag the splitter flush to the left edge. ### Returns GetSplitterOffsetMin returns the current minimum splitter offset in caller-reference (96-DPI) pixels. ### Comments The SetSplitterOffsetMin and GetSplitterOffsetMin functions define and retrieve a minimum splitter offset. They apply only to a split tree control. Once set, the minimum is honored by every mechanism that moves the splitter: mouse drag of the splitter bar, keyboard resize ([EnterResizeMode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_enterresizemode)), and programmatic calls to [SetSplitterOffset](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffset). Offsets below the minimum are clamped to the minimum value. The minimum offset is stored in caller-reference (96-DPI) pixels. When the left tree has opted into [SFTTREE_PIXELSCALING_STRETCH](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_pixelscaling), the effective floor on screen is scaled to the current monitor DPI, matching the pixel-scaling convention. Serialized configurations remain portable between machines of different DPI. GetSplitterOffset returns the current splitter offset; SetSplitterOffset sets it; [MakeSplitterOptimal](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_makesplitteroptimal) repositions it so the left pane shows its [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) without a horizontal scroll bar. All three honor the minimum established by SetSplitterOffsetMin. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SplitterRect *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterrect* Returns the location of the [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) in client area coordinates. C ``` void WINAPI SftTreeSplit_GetSplitterRect(HWND hwndCtl, LPRECT lpRect); ``` C++ ``` void CSftTreeSplit::GetSplitterRect(LPRECT lpRect) const; ``` ### Parameters hwndCtl The window handle of the tree control. lpRect A pointer to a RECT structure where the location of the splitter bar is returned (in pixels). ### Comments The GetSplitterRect function returns the location of the splitter bar in client area coordinates. GetSplitterRect is only available for a split tree control. The RECT structure * lpRect* describes the location of the splitter bar. [SetSplitterOffset](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitteroffset) can be used to change the location of the splitter bar. [SetSplitterWidth](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterwidth) is used to change the width of the splitter bar. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## SplitterWidth *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_splitterwidth* Defines the width of the [splitter bar](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_splitter_bar) in a split tree control. C ``` int WINAPI SftTreeSplit_GetSplitterWidth(HWND hwndCtl); BOOL WINAPI SftTreeSplit_SetSplitterWidth(HWND hwndCtl, int splitWidth); ``` C++ ``` int CSftTreeSplit::GetSplitterWidth() const; BOOL CSftTreeSplit::SetSplitterWidth(int splitWidth); ``` ### Parameters hwndCtl The window handle of the tree control. splitWidth The new width (in pixels) of the splitter bar. Allowable values are between 3 and 7 (including). ### Returns GetSplitterWidth returns the current width (in pixels) of the splitter bar. SetSplitterWidth returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetSplitterWidth and SetSplitterWidth functions define the width of the splitter bar in a split tree control. GetSplitterWidth and SetSplitterWidth are only available for a split tree control. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## StartAutoExpandTimer *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_startautoexpandtimer* Starts a timer for the specified item, so a [SFTTREEN_AUTOEXPANDING](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification will be sent. C ``` BOOL WINAPI SftTree_StartAutoExpandTimer(HWND hwndCtl, int index, BOOL fDeselectedItemsOnly, UINT elapse); BOOL WINAPI SftTreeSplit_StartAutoExpandTimer(HWND hwndCtl, int index, BOOL fDeselectedItemsOnly, UINT elapse); ``` C++ ``` BOOL CSftTree::StartAutoExpandTimer(int index, BOOL fDeselectedItemsOnly, UINT elapse); BOOL CSftTreeSplit::StartAutoExpandTimer(int index, BOOL fDeselectedItemsOnly, UINT elapse); ``` ### Parameters hwndCtl The window handle of the tree control. index Defines the zero-based index of the item, for which a SFTTREEN_AUTOEXPANDING notification will be sent once the timer expires. fDeselectedItemsOnly Set to TRUE to send a SFTTREEN_AUTOEXPANDING notification only if the item described by *index* is not selected. Otherwise, if *fDeselectedItemsOnly* is FALSE, the SFTTREEN_AUTOEXPANDING notification will be sent regardless of the selection status of the item. elapse Defines the time interval (in milliseconds) when the SFTTREEN_AUTOEXPANDING notification will be sent. ### Returns StartAutoExpandTimer returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The StartAutoExpandTimer function starts a timer for the specified item, so a SFTTREEN_AUTOEXPANDING notification will be sent. This function is normally used during [drag & drop](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_dragdrop) processing to implement autoexpanding folders when the mouse cursor hovers over a collapsed folder. Once StartAutoExpandTimer is called, the SFTTREEN_AUTOEXPANDING notification will be sent after *elapse* milliseconds. If StartAutoExpandTimer is called again before the SFTTREEN_AUTOEXPANDING notification is sent, a pending timer is canceled and the timer is restarted. [StopAutoExpandTimer](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_stopautoexpandtimer) can be used to cancel the timer. Once the SFTTREEN_AUTOEXPANDING notification is sent, the application can use the [GetExpandCollapseIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapseindex) function to retrieve the index of the item to expand. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## StopAutoExpandTimer *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_stopautoexpandtimer* Ends a started [SFTTREEN_AUTOEXPANDING](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification timer. C ``` void WINAPI SftTree_StopAutoExpandTimer(HWND hwndCtl); void WINAPI SftTreeSplit_StopAutoExpandTimer(HWND hwndCtl); ``` C++ ``` void CSftTree::StopAutoExpandTimer(); void CSftTreeSplit::StopAutoExpandTimer(); ``` ### Parameters hwndCtl The window handle of the tree control. ### Comments The StopAutoExpandTimer function ends a started SFTTREEN_AUTOEXPANDING notification timer. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## TabKeyIntercept *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tabkeyintercept* Defines the status of Tab key handling during [cell editing](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_cell_editing). C ``` BOOL WINAPI SftTree_GetTabKeyIntercept(HWND hwndCtl); void WINAPI SftTree_SetTabKeyIntercept(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetTabKeyIntercept(HWND hwndCtl); void WINAPI SftTreeSplit_SetTabKeyIntercept(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetTabKeyIntercept() const; void CSftTree::SetTabKeyIntercept(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetTabKeyIntercept() const; void CSftTreeSplit::SetTabKeyIntercept(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to FALSE to allow an application to handle the Tab key for child windows attached to a tree control during cell editing, otherwise set to TRUE. ### Returns GetTabKeyIntercept returns FALSE if the Tab key can be handled by the application, otherwise TRUE is returned. ### Comments The GetTabKeyIntercept and SetTabKeyIntercept functions define the status of Tab key handling during cell editing. This is an advanced function, which can be used to control the default implementation of the Tab key handling during cell editing. By default, if the Tab key is pressed during cell editing and a child control has the input focus, the tree control will generate a [SFTTREEN_VALIDATEEDIT](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) notification. This behavior can be changed by using SetTabKeyIntercept(FALSE), so the tree control no longer generates the notification. It is up to the application or the child window to handle the Tab key and respond accordingly. A child control may not receive the Tab control character, even if SetTabKeyIntercept(FALSE) is used. This is caused by the child control's response to the WM_GETDLGCODE message, which determines if Tab keys are forwarded to the child control. There are several articles relating to this subject in the Microsoft's Knowledge Base. Please see the appropriate Windows documentation for more information on this subject. As an alternative, the [SetKeyHandling](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_keyhandling) function can be used to define keystrokes intercepted during cell editing. Using SetKeyHandling may be easier than subclassing child windows and using TakKeyIntercept. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | Notifications ## Text *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_text* Defines an item's [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text). C ``` int SftTree_GetTextCol(HWND hwndCtl, int index, int realCol, LPTSTR lpszBuffer); int SftTree_GetText(HWND hwndCtl, int index, LPTSTR lpszBuffer); int WINAPI SftTree_GetText_A(HWND hwndCtl, int index, LPSTR lpszBuffer); int WINAPI SftTree_GetText_W(HWND hwndCtl, int index, LPWSTR lpszBuffer); BOOL SftTree_SetTextCol(HWND hwndCtl, int index, int realCol, LPCTSTR lpszText); BOOL SftTree_SetText(HWND hwndCtl, int index, LPCTSTR lpszText); BOOL WINAPI SftTree_SetText_A(HWND hwndCtl, int index, LPCSTR lpszText); BOOL WINAPI SftTree_SetText_W(HWND hwndCtl, int index, LPCWSTR lpszText); int SftTreeSplit_GetTextCol(HWND hwndCtl, int index, int realCol, LPTSTR lpszBuffer); int SftTreeSplit_GetText(HWND hwndCtl, int index, LPTSTR lpszBuffer); int WINAPI SftTreeSplit_GetText_A(HWND hwndCtl, int index, LPSTR lpszBuffer); int WINAPI SftTreeSplit_GetText_W(HWND hwndCtl, int index, LPWSTR lpszBuffer); BOOL SftTreeSplit_SetTextCol(HWND hwndCtl, int index, int realCol, LPCTSTR lpszText); BOOL SftTreeSplit_SetText(HWND hwndCtl, int index, LPCTSTR lpszText); BOOL WINAPI SftTreeSplit_SetText_A(HWND hwndCtl, int index, LPCSTR lpszText); BOOL WINAPI SftTreeSplit_SetText_W(HWND hwndCtl, int index, LPCWSTR lpszText); ``` C++ ``` void CSftTree::GetText(int index, int realCol, CString& string) const; void CSftTree::GetText(int index, CString& string) const; int CSftTree::GetText(int index, int realCol, LPTSTR lpszBuffer) const; int CSftTree::GetText(int index, LPTSTR lpszBuffer) const; BOOL CSftTree::SetText(int index, int realCol, LPCTSTR lpszText); BOOL CSftTree::SetText(int index, LPCTSTR lpszText); void CSftTreeSplit::GetText(int index, int realCol, CString& string) const; void CSftTreeSplit::GetText(int index, CString& string) const; int CSftTreeSplit::GetText(int index, int realCol, LPTSTR lpszBuffer) const; int CSftTreeSplit::GetText(int index, LPTSTR lpszBuffer) const; BOOL CSftTreeSplit::SetText(int index, int realCol, LPCTSTR lpszText); BOOL CSftTreeSplit::SetText(int index, LPCTSTR lpszText); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index number of the item for which text information is to be retrieved or set. realCol The zero-based column number whose text is to be retrieved or set. lpszBuffer A pointer to a buffer containing the item's text or where the item's cell text will be returned. string A reference to a CString object where the item's cell text will be returned. ### Returns GetText(Col) returns the number of characters returned in the buffer, not including the terminating '\0'. The buffer must be large enough to receive the complete text. [GetTextLen](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_textlength) can be used to determine the buffer length needed. -1 is returned if an error occurred. SetText(Col) returns TRUE if the function was successful, otherwise FALSE is returned. ### Comments The GetText and SetText functions define an item's cell text. The text retrieved is based on the column specified using * realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the * realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20DLL%208.0/image/virtual.gif)In a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource), SetText(Col) cannot be used and an error is returned. The *alpszString* member of the [SFTTREE_ITEM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_item) structure is used instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## TextLength *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_textlength* Returns the length of an item's [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text). C ``` int WINAPI SftTree_GetTextLength(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetTextLength(HWND hwndCtl, int index); int SftTree_GetTextColLength(HWND hwndCtl, int index, int realCol); int SftTreeSplit_GetTextColLength(HWND hwndCtl, int index, int realCol); ``` C++ ``` int CSftTree::GetTextLen(int index) const; int CSftTree::GetTextLen(int index, int realCol) const; int CSftTreeSplit::GetTextLen(int index) const; int CSftTreeSplit::GetTextLen(int index, int realCol) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index number of the item for which the text length is to be retrieved. realCol The zero-based column number whose text length is to be retrieved. ### Returns The return value is the length of the item's cell text at the specified (or current) column, not including the terminating '\0' or -1 if an error occurred. ### Comments The GetTextLength function returns the length of an item's cell text. The text length retrieved is based on the column specified using * realCol* or last defined using [SetAccessColumn](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_accesscolumn). Functions, which do not allow the * realCol* parameter, access the column last defined by SetAccessColumn or the last column referenced by a column specific function. The last column accessed can be retrieved using GetAccessColumn. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ToolTipAlways *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipalways* Defines whether [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) are shown even if [cell text](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell_text) is not truncated. C ``` BOOL WINAPI SftTree_GetToolTipAlways(HWND hwndCtl); void WINAPI SftTree_SetToolTipAlways(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetToolTipAlways(HWND hwndCtl); void WINAPI SftTreeSplit_SetToolTipAlways(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetToolTipAlways() const; void CSftTree::SetToolTipAlways(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetToolTipAlways() const; void CSftTreeSplit::SetToolTipAlways(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to display ToolTips even if cell text is not truncated, otherwise set to FALSE. ### Returns GetToolTipAlways returns a value indicating whether ToolTips are shown even if cell text is not truncated. TRUE is returned if ToolTips are shown, otherwise FALSE is returned. ### Comments The GetToolTipAlways and SetToolTipAlways functions define whether ToolTips are shown even if cell text is not truncated. Only [columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) where ToolTips are enabled display ToolTips, regardless of the setting defined using SetToolTipAlways. Individual columns can enable or disable ToolTips by using [GetColumns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_columns) (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex), style). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ToolTipsCallback *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipscallback* Defines an application supplied callback function, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. C ``` BOOL WINAPI SftTree_SetToolTipsCallback(HWND hwndCtl, LPSFTTREE_TOOLTIPSPARM lpToolTips); BOOL WINAPI SftTreeSplit_SetToolTipsCallback(HWND hwndCtl, LPSFTTREE_TOOLTIPSPARM lpToolTips); ``` C++ ``` BOOL CSftTree::SetToolTipsCallback(LPSFTTREE_TOOLTIPSPARM lpToolTips = NULL); BOOL CSftTreeSplit::SetToolTipsCallback(LPSFTTREE_TOOLTIPSPARM lpToolTips = NULL); ``` ### Parameters hwndCtl The window handle of the tree control. lpToolTips A pointer to a [SFTTREE_TOOLTIPSPARM](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_tooltipsparm) structure defining the callback function. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The SetToolTipsCallback function defines an application supplied callback function, which can define the ToolTip text when a ToolTip or ScrollTip is to be displayed. [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) are enabled for each column in the [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex) structure member *style*. [ScrollTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_scrolltips) are enabled using SetScrollTips. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## ToolTipsUseEntireCell *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_tooltipsuseentirecell* Defines whether [ToolTips](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_tooltips) use the entire [cell](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell). C ``` BOOL WINAPI SftTree_GetToolTipsUseEntireCell(HWND hwndCtl); void WINAPI SftTree_SetToolTipsUseEntireCell(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetToolTipsUseEntireCell(HWND hwndCtl); void WINAPI SftTreeSplit_SetToolTipsUseEntireCell(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetToolTipsUseEntireCell() const; void CSftTree::SetToolTipsUseEntireCell(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetToolTipsUseEntireCell() const; void CSftTreeSplit::SetToolTipsUseEntireCell(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE so ToolTips use the entire cell height and width, otherwise set to FALSE. ### Returns GetToolTipsUseEntireCell returns a value indicating whether ToolTips use the entire cell. TRUE is returned if ToolTips use the entire cell height and width, otherwise FALSE is returned. ### Comments The GetToolTipsUseEntireCell and SetToolTipsUseEntireCell functions define whether ToolTips use the entire cell. ToolTips are normally optimized in size to use a minimal amount of space vertically or horizontally to display the cell contents. By setting SetToolTipsUseEntireCell to TRUE, a cell ToolTip will always use the entire cell height and width. SetToolTipsUseEntireCell has no effect if [grid lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_grid_lines) are not shown (see [SetShowGrid](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_showgrid)). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## TopIndex *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_topindex* Defines the index number of the item shown at the top of the tree control. C ``` int WINAPI SftTree_GetTopIndex(HWND hwndCtl); int WINAPI SftTree_SetTopIndex(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetTopIndex(HWND hwndCtl); int WINAPI SftTreeSplit_SetTopIndex(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetTopIndex() const; int CSftTree::SetTopIndex(int index); int CSftTreeSplit::GetTopIndex() const; int CSftTreeSplit::SetTopIndex(int index); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item which will become the first item displayed. ### Returns GetTopIndex returns the zero-based index of the item that is displayed as the first item in the tree control's client area. SetTopIndex returns 0 if the function was successful, otherwise -1 is returned. ### Comments The GetTopIndex and SetTopIndex functions define the index number of the item shown at the top of the tree control. An item must be visible before it can be displayed as the first item. [SetItemShown](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemshown) can be used to make an item visible. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## TopParent *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_topparent* Returns the highest level [parent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_parent) index number for an item. C ``` int WINAPI SftTree_GetTopParent(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetTopParent(HWND hwndCtl, int index); ``` C++ ``` int CSftTree::GetTopParent(int index) const; int CSftTreeSplit::GetTopParent(int index) const; ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index of the item for which the top parent item index is to be retrieved. ### Returns The return value is the zero-based index of the top parent item. -1 is returned if the item requested doesn't have a parent or if an error occurred. ### Comments The GetTopParent function returns the highest level parent index number for an item. The index returned is a direct or indirect parent, which itself has no parent. To retrieve an immediate parent, use [GetParent](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_parent) instead. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## TreeLineStyle *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_treelinestyle* Defines the display style of [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines). C ``` int WINAPI SftTree_GetTreeLineStyle(HWND hwndCtl); void WINAPI SftTree_SetTreeLineStyle(HWND hwndCtl, int style); int WINAPI SftTreeSplit_GetTreeLineStyle(HWND hwndCtl); void WINAPI SftTreeSplit_SetTreeLineStyle(HWND hwndCtl, int style); ``` C++ ``` int CSftTree::GetTreeLineStyle() const; void CSftTree::SetTreeLineStyle(int style); int CSftTreeSplit::GetTreeLineStyle() const; void CSftTreeSplit::SetTreeLineStyle(int style); ``` ### Parameters hwndCtl The window handle of the tree control. style Defines the display style used for selected items. *Style* can be one of the following values: | | | | --- | --- | | SFTTREE_TREELINE_NONE | No tree lines. | | SFTTREE_TREELINE_SOLID | Tree lines are drawn using a solid line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are not connected to each other. | | SFTTREE_TREELINE_DOT | Tree lines are drawn using a dotted line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are not connected to each other. | | SFTTREE_TREELINE_DOT0 | Tree lines are drawn using a dotted line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are also connected to each other. | | SFTTREE_TREELINE_TRANSPARENT | Connecting tree lines are not shown, but all layout and formatting is calculated as if they were present. This only affects the horizontal indentation of levels. | | SFTTREE_TREELINE_AUTOMATIC | The value is translated to SFTTREE_TREELINE_DOT or SFTTREE_TREELINE_TRANSPARENT depending on the operating system used. On Windows 98, ME, 2000, connecting dotted tree lines are shown between items on levels 1 and lower (using SFTTREE_TREELINE_DOT). On Windows XP and above, connecting dotted tree lines are not shown (using SFTTREE_TREELINE_TRANSPARENT). | | SFTTREE_TREELINE_AUTOMATIC0 | The value is translated to SFTTREE_TREELINE_DOT0 or SFTTREE_TREELINE_TRANSPARENT depending on the operating system used. On Windows 98, ME, 2000, connecting dotted tree lines are shown between all items (using SFTTREE_TREELINE_DOT0). On Windows XP and above, connecting dotted tree lines are not shown (using SFTTREE_TREELINE_TRANSPARENT). | ### Returns GetTreeLineStyle returns a value indicating the current display style used for tree lines. ### Comments The GetTreeLineStyle and SetTreeLineStyle functions define the display style of tree lines. The color used for tree lines can be defined using [SFTTREE_COLORS](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_colors), *colorTreeLines*. When printing or previewing the tree control contents using SftPrintPreview/DLL, solid tree lines are used, even if dotted tree lines are defined using SFTTREE_TREELINE_DOT or SFTTREE_TREELINE_DOT0. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## UnregisterApp *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_unregisterapp* Unregisters an application from SftTree/DLL. C ``` void WINAPI SftTree_UnregisterApp(HINSTANCE hInst); ``` C++ ``` static void CSftTree::UnregisterApp(); ``` ### Parameters hInst The instance handle of the application. ### Comments The UnregisterApp function unregisters an application from SftTree/DLL. This call allows SftTree/DLL to unregister all window classes used and perform cleanup processing. This call has to be made after all SftTree/DLL controls have been destroyed. An application should call UnregisterApp once the application no longer uses SftTree/DLL controls. In addition, each thread that called [RegisterApp](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_registerapp) during initialization must call UnregisterApp before the thread terminates. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## UpdateCaretExpandCollapse *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_updatecaretexpandcollapse* Defines whether the current location (caret) is updated when the [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_expandcollapse_buttons) are used. C ``` BOOL WINAPI SftTree_GetUpdateCaretExpandCollapse(HWND hwndCtl); void WINAPI SftTree_SetUpdateCaretExpandCollapse(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetUpdateCaretExpandCollapse(HWND hwndCtl); void WINAPI SftTreeSplit_SetUpdateCaretExpandCollapse(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetUpdateCaretExpandCollapse() const; void CSftTree::SetUpdateCaretExpandCollapse(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetUpdateCaretExpandCollapse() const; void CSftTreeSplit::SetUpdateCaretExpandCollapse(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to update the current location (caret) when the expand/collapse buttons are used. Otherwise, set to FALSE. ### Returns GetUpdateCaretExpandCollapse returns TRUE if the current location (caret) is updated when the expand/collapse buttons are used. Otherwise, FALSE is returned. ### Comments The GetUpdateCaretExpandCollapse and SetUpdateCaretExpandCollapse functions define whether the current location (caret) is updated when the expand/collapse buttons are used. The current location (caret) can be retrieved using the [GetCaretIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_caretindex) function. If the current location is not updated when the expand/collapse buttons are used, the [GetExpandCollapseIndex](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_expandcollapseindex) returns the index of the item where the expand/collapse button was used. GetExpandCollapseIndex returns the same value as GetCaretIndex (i.e., the current item) unless SetUpdateCaretExpandCollapse(FALSE) was used to initialize the tree control. In this case, GetExpandCollapseIndex returns the index of the item whose expand/collapse button was (double-)clicked. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## UseSmoothScroll *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_usesmoothscroll* Defines whether smooth scrolling is used. C ``` BOOL WINAPI SftTree_GetUseSmoothScroll(HWND hwndCtl); void WINAPI SftTree_SetUseSmoothScroll(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetUseSmoothScroll(HWND hwndCtl); void WINAPI SftTreeSplit_SetUseSmoothScroll(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetUseSmoothScroll() const; void CSftTree::SetUseSmoothScroll(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetUseSmoothScroll() const; void CSftTreeSplit::SetUseSmoothScroll(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to enable smooth scrolling, otherwise set to FALSE to disable. ### Returns GetUseSmoothScroll returns TRUE if smooth scrolling is used. ### Comments The GetUseSmoothScroll and SetUseSmoothScroll functions define whether smooth scrolling is used. Smooth scrolling is only used if [column headers](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_column_headers) are not shown (partial window scrolling using smooth scrolling is not possible). See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## UseThemes *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_usethemes* Defines whether the control can use [Windows themes](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_using_themes). C ``` BOOL WINAPI SftTree_GetUseThemes(HWND hwndCtl); void WINAPI SftTree_SetUseThemes(HWND hwndCtl, BOOL fSet); BOOL WINAPI SftTreeSplit_GetUseThemes(HWND hwndCtl); void WINAPI SftTreeSplit_SetUseThemes(HWND hwndCtl, BOOL fSet); ``` C++ ``` BOOL CSftTree::GetUseThemes() const; void CSftTree::SetUseThemes(BOOL fSet = TRUE); BOOL CSftTreeSplit::GetUseThemes() const; void CSftTreeSplit::SetUseThemes(BOOL fSet = TRUE); ``` ### Parameters hwndCtl The window handle of the tree control. fSet Set to TRUE to allow the control to use Windows themes, otherwise set to FALSE. ### Returns GetUseThemes returns a value indicating whether Windows themes can be used. TRUE is returned if themes can be used, otherwise FALSE is returned. ### Comments The GetUseThemes and SetUseThemes functions define whether the control can use Windows themes. Windows themes are only available on Windows XP and above. Older Windows versions do not support Windows themes and this function has no effect. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## VAlign *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_valign* Defines the vertical alignment of [tree lines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_tree_lines), [label pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_label_bitmap), [plus/minus bitmap](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_plusminus_bitmap) and [item pictures](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_item_bitmap). C ``` DWORD WINAPI SftTree_GetVAlign(HWND hwndCtl); void WINAPI SftTree_SetVAlign(HWND hwndCtl, DWORD style); DWORD WINAPI SftTreeSplit_GetVAlign(HWND hwndCtl); void WINAPI SftTreeSplit_SetVAlign(HWND hwndCtl, DWORD style); ``` C++ ``` DWORD CSftTree::GetVAlign() const; void CSftTree::SetVAlign(DWORD style); DWORD CSftTreeSplit::GetVAlign() const; void CSftTreeSplit::SetVAlign(DWORD style); ``` ### Parameters hwndCtl The window handle of the tree control. style A value describing the desired vertical alignment. | | | | --- | --- | | SFTTREE_VCENTER | The tree lines, label pictures, plus/minus bitmap and item pictures are vertically centered within the item. | | SFTTREE_TOP | The tree lines, label pictures, plus/minus bitmap and item pictures are aligned with the top of the item. | | SFTTREE_BOTTOM | The tree lines, label pictures, plus/minus bitmap and item pictures are aligned with the bottom of the item. | ### Returns GetVAlign returns the current vertical alignment of tree lines, label pictures, plus/minus bitmap and item pictures. ### Comments The GetVAlign and SetVAlign functions define the vertical alignment of tree lines, label pictures, plus/minus bitmap and item pictures. [Columns](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_columns) and [cells](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/pop_cell) can further define the vertical alignment of cell contents (see [SFTTREE_COLUMN_EX](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_column_ex), *style* member and [SFTTREE_CELL](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_cell), *flag* member). Vertical alignment is usually only used if [SetItemLines](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_itemlines) is used to define more than one line of text. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## VirtualCount *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualcount* Defines the number of items when using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource). C ``` BOOL WINAPI SftTree_VirtualCount(HWND hwndCtl, LONG items, LONG itemsVisible, int maxLevels); BOOL WINAPI SftTreeSplit_VirtualCount(HWND hwndCtl, LONG items, LONG itemsVisible, int maxLevels); ``` C++ ``` BOOL CSftTree::VirtualCount(LONG items, LONG itemsVisible, int maxLevels = 0); BOOL CSftTreeSplit::VirtualCount(LONG items, LONG itemsVisible, int maxLevels = 0); ``` ### Parameters hwndCtl The window handle of the tree control. items Specifies the current number of items to be managed by the tree control (including visible and hidden items). itemsVisible Specifies the current number of visible items to be managed by the tree control. For a flat list (without hierarchy) *itemsVisible* must be equal to *items*. maxLevels Specifies the lowest level on which any item can appear. For a flat list (without hierarchy) this value must be set to 0. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. If the tree control is not a virtual tree control (items have been adding using [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) or [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring)), this function will fail. ### Comments The VirtualCount function defines the number of items when using a virtual data source. Whenever the number of items in the virtual data source changes, the application can call this function to notify the tree control. [VirtualInitialize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualinitialize) must be used to initialize a tree control for use with a virtual data source. [GetCount](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_count) can be used to retrieve the current number of items. If the number of items is changed using VirtualCount, the tree control does not preserve the current index or the current [selections](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_selections). It is up to the application to preserve or update these. Only flat lists (without hierarchy) are supported. To insure compatibility with future releases of SftTree/DLL, *items* and *itemsVisible* must be equal and *maxLevels* must be set to 0. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## VirtualInitialize *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualinitialize* Initializes a tree control for [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode) and for use with a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource). C ``` BOOL WINAPI SftTree_VirtualInitialize(HWND hwndCtl, LPCSFTTREE_VIRTUALDEF virt); BOOL WINAPI SftTreeSplit_VirtualInitialize(HWND hwndCtl, LPCSFTTREE_VIRTUALDEF virt); ``` C++ ``` BOOL CSftTree::VirtualInitialize(LPSFTTREE_VIRTUALDEF virt); BOOL CSftTreeSplit::VirtualInitialize(LPSFTTREE_VIRTUALDEF virt); ``` ### Parameters hwndCtl The window handle of the tree control. virt A pointer to a [SFTTREE_VIRTUALDEF](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_virtualdef) structure describing the virtual data source. Specify NULL to discontinue using the tree control in virtual mode. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The VirtualInitialize function initializes a tree control for virtual mode and for use with a virtual data source. Once items have been added to a tree control using [AddString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_addstring) or [InsertString](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_insertstring), VirtualInitialize can no longer be used. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## VirtualItemChanged *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualitemchanged* Notifies a tree control using a [virtual data source](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_datasource) that items have been changed. C ``` BOOL WINAPI SftTree_VirtualItemChanged(HWND hwndCtl, LONG index); BOOL WINAPI SftTreeSplit_VirtualItemChanged(HWND hwndCtl, LONG index); ``` C++ ``` BOOL CSftTree::VirtualItemChanged(LONG index = -1); BOOL CSftTreeSplit::VirtualItemChanged(LONG index = -1); ``` ### Parameters hwndCtl The window handle of the tree control. index The zero-based index number of the item which has been modified in the virtual data source. If -1 is used, all items in the virtual data source are considered altered. ### Returns The return value is TRUE if the function was successful, otherwise FALSE is returned. ### Comments The VirtualItemChanged function notifies a tree control using a virtual data source that items have been changed. By notifying the tree control that items in the virtual data source have changed, the items in the tree control can be repainted if needed, reflecting their new attributes. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications) ## VirtualUserData *Source: https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualuserdata* Returns the application defined value last used in the [SFTTREE_VIRTUALDEF](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/struct_sfttree_virtualdef) structure when [VirtualInitialize](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/function_virtualinitialize) was called. C ``` SFTTREE_DWORD_PTR WINAPI SftTree_GetVirtualUserData(HWND hwndCtl); SFTTREE_DWORD_PTR WINAPI SftTreeSplit_GetVirtualUserData(HWND hwndCtl); ``` C++ ``` SFTTREE_DWORD_PTR CSftTree::GetVirtualUserData() const; SFTTREE_DWORD_PTR CSftTreeSplit::GetVirtualUserData() const; ``` ### Parameters hwndCtl The window handle of the tree control. ### Returns Returns the application defined value last used in the SFTTREE_VIRTUALDEF structure when VirtualInitialize was called. NULL is returned if [virtual mode](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/g_virtual_mode) has not been initialized. ### Comments The GetVirtualUserData function returns the application defined value last used in the SFTTREE_VIRTUALDEF structure when VirtualInitialize was called. GetVirtualUserData provides the mechanism to retrieve the application defined value last used in the SFTTREE_VIRTUALDEF structure when VirtualInitialize was called. This is usually used when only the tree control window handle or window object is known, and the application needs the value so it can access additional application specific information. See Also [C/C++ API](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_api) | [Categories](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_categories) | [Notifications](https://softelvdm.com/Documentation/SftTree%20DLL%208%200/Topic/i_notifications)