September 18, 1999

GetTreeViewNodeRect – The bounding rectangle of a TreeView’s node

Option ExplicitPrivate Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongType RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePrivate Const TV_FIRST = &H1100Private Const TVM_GETITEMRECT = (TV_FIRST

GetTreeViewFirstVisibleNode – Retrieve the first visible node in a TreeView

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Const TV_FIRST = &H1100Private Const TVM_GETNEXTITEM = (TV_FIRST + 10)Private Const TVM_SELECTITEM = (TV_FIRST + 11)Private Const TVGN_CARET = 9Private Const TVGN_FIRSTVISIBLE =

GetTreeViewNodeHandle – The handle of any node in a TreeView

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Const TVM_GETNEXTITEM = &H110APrivate Const TVGN_CARET = 9′ The handle of any node in a TreeView” While VB developers reason in terms of

GetTreeViewSelNodeHandle – The handle of a TrewView’s selected node

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Const TV_FIRST = &H1100Private Const TVM_GETNEXTITEM = (TV_FIRST + 10)Private Const TVGN_CARET = 9′ the handle of the TreeView node that is currently

SetTreeViewFirstVisibleNode – Set the first visible node in a TreeView control

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Const TV_FIRST = &H1100Private Const TVM_GETNEXTITEM = (TV_FIRST + 10)Private Const TVM_SELECTITEM = (TV_FIRST + 11)Private Const TVGN_CARET = 9Private Const TVGN_FIRSTVISIBLE =

Get or Set the height of TreeView nodes

In plain VB there is no way to determine or change the height of node elements in a TreeView control. All you need to accomplish both tasks, however, is send the right message to the control. Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hWnd As Long, ByVal