Hi, Is it works?
I just design app that support usb dongle / hardware key. It can fire an event whenever any usb device type inserted. It can determine whether the device is human interface device type, HID It works very well. I think it listen for msg in WndProc. Not remember very well. But I got the code in my archive disk. Last year I done it. hehe. On Mar 10, 3:32 pm, tef <[email protected]> wrote: > Thanks R.Ram Mohan & C.Arun Kumar yours information.. is very > helpful.. thanks again. > > On Mar 7, 5:26 am, Ram Mohan Rama Chandran <[email protected]> > wrote: > > > you have try this coding > > Private WithEvents m_MediaConnectWatcher As > > System.Management.ManagementEventWatcher > > Private Sub Form1_Load(ByVal sender As Object, ByVal e As > > System.EventArgs) Handles MyBase.Load > > Dim query As String = "SELECT * FROM Win32_DeviceChangeEvent" > > Dim query2 As String = "SELECT * FROM __InstanceCreationEvent WITHIN > > 5 WHERE TargetInstance ISA ""Win32_USBHub""" > > m_MediaConnectWatcher = New > > System.Management.ManagementEventWatcher(query2) > > m_MediaConnectWatcher.Start() > > End Sub > > > On Fri, Mar 6, 2009 at 5:29 AM, tef <[email protected]> wrote: > > > > hi all, > > > > can anyone help me on concept/code to auto detect usb storage when it > > > was inserted into computer... i m using VB2005.. > > > > thanks > > > -- > > R.Ram Mohan
