SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
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);
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.
The return value is the zero-based index of the newly added item. The return value is -1 if an error occurred.
The InsertString function inserts a new item using a string.
By default, new items are added at level 0. Use SetItemLevel to change an item's level.
The tree control creates a copy of the string supplied.
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 | Categories | Notifications