foozoor Posted July 27, 2015 Posted July 27, 2015 (edited) I want to store as an array all the monitor names from the "devices" item.As you can see, all the "devices" children are trees too, don't know if it complicates things.So the returned array should be this:['Lenovo LTN116AT06402', 'Lenovo LTN116AT06', 'Lenovo LTN116AT']This is my current code:expandcollapse popup#include <Array.au3> #include <GUIConstants.au3> #include <GuiTreeView.au3> #include <WinAPIGdi.au3> ; Assign some global variables. Global $g_sMadPath = 'C:\Program Files\LAV Filters\x86\madVR\' Global $g_sMadExec = $g_sMadPath & 'madHcCtrl.exe editLocalSettingsDontWait' Global $g_sMadSett = $g_sMadPath & 'settings.bin' Global $g_sMadProc = 'madHcCtrl.exe' Global $g_sMadHand = '[CLASS:TFMadVRSettings]' ; Initialize the madvr settings gui window. Func Initialize() ; Close madvr settings process if exists. If ProcessExists($g_sMadProc) Then ProcessClose($g_sMadProc) EndIf ; Run madvr settings application. Run($g_sMadExec) ; Wait for the madvr settings window. WinWaitActive($g_sMadHand, '', 10) ; Set window transparency to 0. ; WinSetTrans($g_sMadHand, '', 0) EndFunc ; Get all monitor devices. Func GetMonitors() ; Initialize madvr settings. Initialize() ; Get the tree element handle. Local $hTreeView = ControlGetHandle($g_sMadHand, '', 'TTreeView1') Local $hDevices = _GUICtrlTreeView_FindItem($hTreeView, 'devices') ; Count the devices children, available monitors. Local $iChildren = ControlTreeView($g_sMadHand, '', $hTreeView, 'GetItemCount', 'devices') ; Array to store children text, the monitor names. Local $aMonitorNames = [] ; TODO: Get children subtree texts and store them inside the array. ; Debug: the returned array. _ArrayDisplay($aMonitorNames) ; Return the array. Return $aMonitorNames EndFunc Edited July 27, 2015 by foozoor
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