I want to know how to detect devices (specifically USB devices) upon plug-in and for instance do something (MsgBox would be OK for a start).
Now I did some searching here and concluded that I should do more reading on WMI.
I did some reading and I understand that I need to monitor events generated by windows.
One of those events might as well be a device being plugged into a USB port (which is what I need to detect).
Alas I only have limited programming knowledge and really no computer science background, so stuff like "\root\CIMV2" and objWMIService.ExecNotificationQuery (especially what to write as the string parameter there) got me confused a little.
The topics I found here and elsewhere on the web deal with detecting drives and specifically drive letters but I need to be able to detect any USB device, such as a USB controller or a virtual serial port for instance.
My resources so far:
The topic about detecting drives: http://www.autoitscript.com/forum/topic/42402-detecting-usb-drive-insertion/
I also found a list of win32 classes on MSDN so that might be helpful as well but I'm still not sure how to implement this: http://msdn.microsoft.com/en-us/library/windows/desktop/aa389273(v=vs.85).aspx
Monitoring Events (MSDN): http://msdn.microsoft.com/en-us/library/windows/desktop/aa392396(v=vs.85).aspx
Hopefully you guys will be able to help me and smoothen the learning curve...