WesW Posted April 4, 2011 Share Posted April 4, 2011 What is the best way to do this... I am trying to click the app in the treeview and have it install. any suggestions? expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTreeView.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <Constants.au3> #include <StaticConstants.au3> Opt('MouseCoordMode', 2) Global $GUI, $hTreeView, $Context, $currentBtn = 0, $hGraphic, $hPen, $CurrentItem = "" _Main() Func _Main() Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS) ;Create Main UI $GUI = GUICreate("Automated Installs", 300, 404) ;Building the Treeview $hTreeView = _GUICtrlTreeView_Create($GUI, 2, 2, 296, 400, $iStyle, $WS_EX_CLIENTEDGE) _GUICtrlTreeView_BeginUpdate($hTreeView) $Parent = _GUICtrlTreeView_Add($hTreeView, 0, "Design and Engeeners Builds") _GUICtrlTreeView_AddChild($hTreeView, $Parent, "Designer build V8I 03.16.2011.exe") _GUICtrlTreeView_AddChild($hTreeView, $Parent, "Engineer Build 03.27.2011.exe") $Parent = _GUICtrlTreeView_Add($hTreeView, 0, "ProjectWise") _GUICtrlTreeView_AddChild($hTreeView, $Parent, "ProjectWise Build XP") _GUICtrlTreeView_AddChild($hTreeView, $Parent, "ProjectWsie Build Win 7" ) _GUICtrlTreeView_EndUpdate($hTreeView) GUISetState(@SW_SHOW, $GUI) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc ;==>_Main Link to comment Share on other sites More sharing options...
WesW Posted April 4, 2011 Author Share Posted April 4, 2011 Time for a drink... Would anybody like to join me Link to comment Share on other sites More sharing options...
WesW Posted April 5, 2011 Author Share Posted April 5, 2011 any suggestions? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 5, 2011 Moderators Share Posted April 5, 2011 WesW,So you have found absolutely nothing on how you might do this by searching the forum? A couple of possibilities spring to mind:- 1. If you want to select more than one option at a time, you can use the $TVS_CHECKBOXES style. Then you would need to loop through the TreeViewItems to see which were checked.- 2. If you want just the one selection you can look for a double-click in a WM_NOTIFY handler - then you could use GUICtrlRead or _GUICtrlTreeView_GetTree to see what has been selected.I hope that helps gets you going in the right direction. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now