How can I disable the attached or built-in webcam(s) programmatically under Windows?
By disabling them, I mean that any program trying to access the cameras should either:
Why I want to do this:
I have a laptop with a webcam. There's no easy way to disable it via software. I want to create an application with a button that disables the webcam, so that any application that wants to use it will be unable to, and a button to re-enable it. I don't want to put anything over the cam physically, otherwise I wouldn't be asking this question here.
Here are two links here on SO to enable/disable a device programmatically:
How do I disable a system device?
Win32 API function to programmatically enable/disable device
There is also an official tool, DevCon, that you could automate.
DevCon (Devcon.exe), the Device Console, is a command-line tool that displays detailed information about devices on computers running Windows. You can use DevCon to enable, disable, install, configure, and remove devices.