z0ne Posted September 24, 2013 Share Posted September 24, 2013 Hi there I am trying to get some information from the device manager to use in a later bit of my autoit script. I've just about managed to open up the device manager and I am now trying to send some simple key strokes to get to the menu and then get the text. I've tried loads of things including controlsend although whether or not I put it right I am not sure! Here is my current code any help would be greatly appreciated, otherwise i'll keep perceiving anyway! Run(@ComSpec & " /c " & 'devmgmt.msc', "") WinWaitActive("Device Manager") Sleep(2000) Send("{TAB}") Sleep(1000) Send("port") Send("{RIGHT}") Send("{DOWN}") Sleep(500) ControlSend("{ENTER}") Sleep(1000) $comport = ControlGetText("","",219) MsgBox(0,"$comport","$comport") Device Manager list summary expandcollapse popup>>>> Window <<<< Title: Device Manager Class: MMCMainFrame Position: 71, 42 Size: 795, 579 Style: 0x14CF0000 ExStyle: 0x00000100 Handle: 0x002D0434 >>>> Control <<<< Class: SysTreeView32 Instance: 1 ClassnameNN: SysTreeView321 Name: Advanced (Class): [CLASS:SysTreeView32; INSTANCE:1] ID: Text: Position: 2, 58 Size: 773, 446 ControlClick Coords: 173, 60 Style: 0x56200007 ExStyle: 0x00000000 Handle: 0x002703FA >>>> Mouse <<<< Position: 255, 196 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Device Manager on local computer >>>> Hidden Text <<<< ActionsPaneView 0 The location of the information i want to grab expandcollapse popup>>>> Window <<<< Title: USB Serial Port (SLM14x) (COM3) Properties Class: #32770 Position: 190, 50 Size: 556, 562 Style: 0x94C820C4 ExStyle: 0x00010101 Handle: 0x001B051E >>>> Control <<<< Class: Static Instance: 2 ClassnameNN: Static2 Name: Advanced (Class): [CLASS:Static; INSTANCE:2] ID: 219 Text: USB Serial Port (SLM14x) (COM3) Position: 86, 51 Size: 348, 32 ControlClick Coords: 142, 12 Style: 0x50020080 ExStyle: 0x00000004 Handle: 0x000E0530 >>>> Mouse <<<< Position: 427, 149 Cursor ID: 0 Color: 0x0066B6 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< General USB Serial Port (SLM14x) (COM3) Device type: Ports (COM & LPT) Manufacturer: FTDI Location: on USB Serial Converter (SLM14x) Device status This device is working properly. OK Cancel >>>> Hidden Text <<<< &Troubleshoot... Change settings &Apply Help Link to comment Share on other sites More sharing options...
FireFox Posted September 24, 2013 Share Posted September 24, 2013 Hi, Have you tried the _GUICtrlTreeView* functions? Br, FireFox. Link to comment Share on other sites More sharing options...
z0ne Posted September 24, 2013 Author Share Posted September 24, 2013 Hi, Have you tried the _GUICtrlTreeView* functions? Br, FireFox. I haven't yet really just getting to grips with autoit my first project and use of the language having to look up everything every time I want to do something haha. Thanks for your help I'll have a read now! Link to comment Share on other sites More sharing options...
FireFox Posted September 24, 2013 Share Posted September 24, 2013 It was just a simple question, I didn't mean you should have known those functions Link to comment Share on other sites More sharing options...
kylomas Posted September 24, 2013 Share Posted September 24, 2013 z0ne66, The location of the information i want to grab But you have not said what info you are looking for. If it is device info you may be better off using WMI to interrogate device properties. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
z0ne Posted September 24, 2013 Author Share Posted September 24, 2013 It was just a simple question, I didn't mean you should have known those functions Of course not i'm just grateful to have something to try just got to do some reading on it first Link to comment Share on other sites More sharing options...
z0ne Posted September 24, 2013 Author Share Posted September 24, 2013 z0ne66, But you have not said what info you are looking for. If it is device info you may be better off using WMI to interrogate device properties. kylomas The information I want is "USB Serial Port (SLM14x) (COM3)" which I was planning on stripping down to just "COM3". If that helps you help me at all Link to comment Share on other sites More sharing options...
kylomas Posted September 24, 2013 Share Posted September 24, 2013 z0ne66, The information I want is "USB Serial Port (SLM14x) (COM3)" which I was planning on stripping down to just "COM3". If that helps you help me at all Then no need for all the Window hooey. Do a forum search on "usb serial port". There are a couple of different ways to get USB device info. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
z0ne Posted September 25, 2013 Author Share Posted September 25, 2013 Feel like i've found an alternative using devcon although I haven't fully implemented it yet as really knowing the com port is a tiny part of what I want to do. Just wondering now if anyone just give a reason why my original implementation didn't work. Many thanks, z0ne 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