2

I'm trying to create a security application and I need to prevent the user to use windows 10 (lock) and only use my application by writing a password to unlock it, is there a way to do that?

note: i dont want to use rundll32.exe to logout from the system

Process.Start(@"C:\WINDOWS\system32\rundll32.exe", "user32.dll,LockWorkStation");

Nathan Champion
  • 1,291
  • 1
  • 14
  • 23
Eng.Maher
  • 73
  • 8
  • 2
    ‘freezes’ is likely not the correct word. Anyway, searching for GINA and “replace windows login” or “locked screensaver” might yield interesting reads. – user2864740 Jul 14 '20 at 19:41
  • 1
    What about Lock the PC by emulationg `Win+L` press, or something like [this](https://gist.github.com/Hexalon/b535d1afa578e9c476ab) – aepot Jul 14 '20 at 19:45
  • Indeed: you want to lock the system, freezing is for bad software or system crashes. –  Jul 14 '20 at 19:45
  • I just want it to lock the system without using Win+L, and use my application only – Eng.Maher Jul 14 '20 at 19:49
  • You want to do like system software and antivirus or UAC that block the system to show an advert by blocking all others software, isn't it ? –  Jul 14 '20 at 19:50
  • yes how to do that ? – Eng.Maher Jul 14 '20 at 19:52
  • Are you trying to override the lock screen functionality on Windows 10? So, instead of Windows prompting for a password your program does that instead? – Nathan Champion Jul 14 '20 at 19:54
  • Found that and I can't set duplicate again: [UAC-style elevated prompt (C#)](https://stackoverflow.com/questions/7807761/uac-style-elevated-prompt) & [UAC prompt elevation - how does it work? (C++)](https://stackoverflow.com/questions/7808237/uac-prompt-elevation-how-does-it-work) –  Jul 14 '20 at 19:54
  • 1
    My question to you is why? You can install your own "Credential Provider" (the newer, more flexible replacement for GINA). The Windows Lock screen does a lot for you (switching desktops, providing access to other security features, etc.). Why do you think you want to do this. – Flydog57 Jul 14 '20 at 21:02
  • 2
    It sounds more like you're wanting a [kiosk application](https://learn.microsoft.com/en-us/windows/configuration/kiosk-methods)? – Idle_Mind Jul 14 '20 at 21:03

0 Answers0