Jump to content
Sign in to follow this  

Selecting SubItems in TreeView

Recommended Posts


I am trying (stress trying) to create a server documentation app using treeview. So far the menu looks like:














My question: How do I write the code to showing that I selected for example filesrv03, doc3 and show that doc in a window using explorer. Thanks for your help.

My code so far:

#include <GuiConstantsEx.au3>

#include <GuiTreeView.au3>

#include <GuiTab.au3>

#include <Array.au3>

Global $hGUI, $hTreeView, $hTemp, $docs, $idButton

Dim $srvlst

Local $aArray[5] = ["Backup", "Baseline", "ChangeControl", "ComplianceCheck", "Configuration"]; subitems, documents for each server

Local $j

$hGUI = GUICreate("Server Compliance Reports", 1696, 1000)

$hTreeView = _GUICtrlTreeView_Create($hGUI, 30, 30, 200, 880)

$hTemp = _GUICtrlTreeView_Add($hTreeView, 0, "Server Compliance Reports")

$hTemp = _GUICtrlTreeView_AddChild($hTreeView, $hTemp, "Servers")

$srvlst = IniReadSection("servers.ini", "Servers")

For $i = 1 To $srvlst[0][0] Step +1

$docs = _GUICtrlTreeView_AddChild($hTreeView, $hTemp, $srvlst[$i][1])

For $j = 0 to 5 - 1

_GUICtrlTreeView_AddChild($hTreeView, $docs, $aArray[$j])



$idButton = GUICtrlCreateButton("Close", 280, 120)


While 1

Switch GUIGetMsg()



Case $idButton




Share this post

Link to post
Share on other sites

Here is a working example that registers WM_NOTIFY to detect an item being clicked in a TreeView and then displaying which item.


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.