vikrams Posted July 23, 2013 Share Posted July 23, 2013 (edited) Hi All , I want to automate driver installation using device manager . I am able to get device manager windows pop up but i am not able to select root tree item . Please let me know i am missing something given below code #Include <GuiTreeView.au3> ShellExecute('devmgmt.msc') WinWaitActive("Device Manager") Global $hTree = ControlGetHandle("Device Manager", "", "[Class:SysTreeView32;Instance:1]") MsgBox(0, "ControlGetHandle Example", "The control handle of Edit1 is: " & $hTree) $hItem = _GUICtrlTreeView_FindItem($hTree, "Human Interface Device", True) _GUICtrlTreeView_SelectItem($hTree, $hItem, $TVGN_CARET) $next = _GUICtrlTreeView_GetNext($hTree, $hItem) ; Focus treeview and Send Enter ControlFocus("Device Manager", "", $hTree) ControlSend("Device Manager", "", $hItem, "{ENTER}") Exit Thanks and Regards, Vikram Edited July 23, 2013 by vikrams Link to comment Share on other sites More sharing options...
orbs Posted July 23, 2013 Share Posted July 23, 2013 the way to automate such system-related tasks is rarely best handled by the GUI. have you tried DevCon? http://msdn.microsoft.com/en-us/library/windows/hardware/ff544707(v=vs.85).aspx Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
vikrams Posted July 23, 2013 Author Share Posted July 23, 2013 (edited) thanks Orbs about Devcon, actually i want to automatation on autoit. Please if you have any idea about what is wrong in the above code Edited July 23, 2013 by vikrams Link to comment Share on other sites More sharing options...
spudw2k Posted July 23, 2013 Share Posted July 23, 2013 (edited) Seems to work for me. HID root is selected and next returns the handle for the next treeview item. What are you trying to do with the tree view? What do you expect to happen when you send "{Enter}"? Also, I agree with Orbs suggestion. Edited July 23, 2013 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF 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