Returns the ID of the currently selected node in a TreeView control.
Takes parentTreeview (Int).
Returns the item's lParam value (which stores the node ID).
BGI GUI
Parameters & Returns
Parameters
parentTreeviewInt
Returns
Int
Quick Summary
Returns the ID of the currently selected node in a TreeView control.
Takes parentTreeview (Int).
Returns the item's lParam value (which stores the node ID).
Technical Exegesis...
Returns the ID of the currently selected node in a TreeView control. Searches gizmoMap for parentTreeview ID to get TreeView HWND. Calls TreeView_GetSelection macro to get the selected node's HTREEITEM. Creates TVITEM structure with hItem=selectedNode and mask=TVIF_PARAM. Calls TreeView_GetItem to retrieve the item data. Returns the item's lParam value (which stores the node ID). Returns 0 if no item selected or TreeView_GetItem fails. Returns -1 if TreeView not found.
Returns the ID of the currently selected node in a TreeView control. Searches gizmoMap for parentTreeview ID to get TreeView HWND. Calls TreeView_GetSelection macro to get the selected node's HTREEITEM. Creates TVITEM structure with hItem=selectedNode and mask=TVIF_PARAM. Calls TreeView_GetItem to retrieve the item data. Returns the item's lParam value (which stores the node ID). Returns 0 if no item selected or TreeView_GetItem fails. Returns -1 if TreeView not found.
This function retrieves the node ID of the currently selected/highlighted TreeView item. TreeView_GetSelection is a macro that wraps TVM_GETNEXTITEM with TVGN_CARET. The node ID is stored in TVITEM.lParam field (set during node creation in bgiAttachGizmoRootNode/bgiAppendGizmoChildNode). Returns 0 when TreeView has no selection (not the same as node ID 0). Use for processing selections, implementing context menus, or getting selected item details. Common pattern: get selected node ID, then use bgiGetGizmoNodeText to get text.