How cam i use regedit or WPF disable and enable camera immediately(Windows 10)

haoming.hsu 1 Reputation point
2020-11-23T03:10:26.117+00:00

I use WPF do a camera detection APP,
I want the app can turn off and turn on immediately even if the webcam already open

but I try many methods can't finish it

  1. regedit set Value=Allow or Deny
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global{E5323777-F976-4f5b-9B55-B94699C46E44}\Value
  2. regedit set Value=Allow or Deny
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam\Value
  3. set LetAppsAccessCamera=00000002(use Administrator)
    HKEY_LOCAL_MACHINE \ SOFTWARE \ Policies \ Microsoft \ Windows \ AppPrivacy\LetAppsAccessCamera
  4. use devcon.exe run disable this USB camera, but if i want to enable this I have to reboot computer...

only this method can turn off webcam immediately, but my app can't trigger this action
click this button
41680-2020-11-23-11-03-47-a000010501-101772531-service-m.png

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,771 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.