#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
Global $tmp[3]
GUICreate("Form1", 180, 260)
$Button1 = GUICtrlCreateButton("OK", 40, 200, 100, 41)
$TreeView1 = GUICtrlCreateTreeView(5, 5, 150, 150, $TVS_CHECKBOXES)
$ALL = GUICtrlCreateTreeViewItem("ALL", $TreeView1)
GUICtrlSetState(-1, 1)
$tmp[0] = GUICtrlCreateTreeViewItem("A", $TreeView1)
$tmp[1] = GUICtrlCreateTreeViewItem("B", $TreeView1)
$tmp[2] = GUICtrlCreateTreeViewItem("C", $TreeView1)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case - 3
Exit
Case $Button1
If BitAND(GUICtrlRead($ALL), 1) Then
MsgBox(4096, "A", "Hi..A")
MsgBox(4096, "B", "Hi..B")
MsgBox(4096, "C", "Hi..C")
Else
For $i = $tmp[0] To $tmp[UBound($tmp) - 1]
If BitAND(GUICtrlRead($i), 1) Then MsgBox(4096, "", "read" & $i - $tmp[0])
Next
EndIf
EndSwitch
WEnd
|