I've a fairly complex Rainmeter skin that does lots of things, and my level of Rainmeter knowledge is decent enough. However, I don't know how to detect whether or not a particular USB device - a webcam - is plugged in or not. I can get various details about this device via various Windows and third-party programs; what I don't know is how to make use of that information to detect, via Rainmeter and fairly efficiently (I'll use a timer that runs every 15 seconds or so), whether the device is plugged in.
Can anyone think of a way to do this, please? Thanks.
I did write this to detect if my F: USB drive got plugged in, maybe that could be a start? It automatically loads another skin. Not sure if you can do it for webcam though. You might be able to modify the first part to detect that devices if you can get the skin to read it's active.
Bananorpion wrote:My guess would be using the RunCommand measure type.
That would make sense . .
Bananorpion wrote:Which Windows programs/commands do you use to get your information?
Yet, I am getting the information from graphical programs - namely, the Windows Device Manager, and the third-party program 'USB safely remove'. So I don't know what commands to run from Rainmeter.
I suspect you will need some hardware identification details to pass to WMIC, but sounds like maybe you can get that information for your device from device manager.
Just a word of caution, never use WMIC to "poll" for information constantly. WMIC is slow as molasses in January, and will use more CPU than you will like. It's ok a few times a minute or so, but never, ever once a second.