#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
GUICreate("_GUICtrlTreeView_HideCheckBox", 400, 300)
$nTV = GUICtrlCreateTreeView(150, 50, 200, 200, BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_CHECKBOXES), $WS_EX_CLIENTEDGE)
$nProgs_Item = GUICtrlCreateTreeViewItem("Programs", $nTV)
_GUICtrlTreeView_HideCheckBox($nTV, $nProgs_Item)
$nItem1 = GUICtrlCreateTreeViewItem("Notepad", $nProgs_Item)
$nItem2 = GUICtrlCreateTreeViewItem("Calc", $nProgs_Item)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func _GUICtrlTreeView_HideCheckBox($hTV, $nID)
Local $hWnd = GUICtrlGetHandle($hTV)
If $hWnd = 0 Then $hWnd = $hTV
Local $hItem = GUICtrlGetHandle($nID)
If $hItem = 0 Then $hItem = $nID
Local $tvItem = DllStructCreate("uint;dword;uint;uint;ptr;int;int;int;int;int;int")
DllStructSetData($tvItem, 1, $TVIF_STATE)
DllStructSetData($tvItem, 2, $hItem)
DllStructSetData($tvItem, 3, 0)
DllStructSetData($tvItem, 4, $TVIS_STATEIMAGEMASK)
$nResult = DllCall("user32.dll", "int", "SendMessage", "hwnd", $hWnd, "int", $TVM_SETITEMA, "int", 0, "int", DllStructGetPtr($tvItem))
EndFunc