Jump to content
Sign in to follow this  
z0ne

Sending keys to device manager

Recommended Posts

z0ne

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

>>>> 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

>>>> 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
 

Share this post


Link to post
Share on other sites
FireFox

Hi,

Have you tried the _GUICtrlTreeView* functions?

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
z0ne

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!

Share this post


Link to post
Share on other sites
FireFox

It was just a simple question, I didn't mean you should have known those functions :)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
kylomas

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

Share this post


Link to post
Share on other sites
z0ne

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 

Share this post


Link to post
Share on other sites
z0ne

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

Share this post


Link to post
Share on other sites
kylomas

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

Share this post


Link to post
Share on other sites
z0ne

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

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  

×