I have had a request from my employer to make a program that sort of locks windows until some tasks have been completed, a bit like what happens when the UAC box appears.
Is this possible in C#?
I have had a request from my employer to make a program that sort of locks windows until some tasks have been completed, a bit like what happens when the UAC box appears.
Is this possible in C#?
This topic is essentially asking whether an application can reproduce the UAC "lock the desktop" behavior. 's overlay idea and sample are fine as a UI trick for guided workflows, and is correct that the Secure Attention Sequence (Ctrl+Alt+Del) is controlled by the OS and cannot be caught by normal user code.
Important system facts to know before choosing a path: UAC prompts show on a separate "secure" desktop hosted by the system (Winlogon), not by a regular top-level window. The Win32 APIs used to create and switch desktops (CreateDesktop, SwitchDesktop) exist, but switching to a new desktop in a safe, reliable way requires elevated privileges and careful handling of window stations, sessions, and access rights. Services no longer interact with the interactive session because of session 0 isolation, so a naive service-to-desktop approach will fail on modern Windows.
Practical options and recommendations:
Ctrl+Alt+Del (that requires kernel-level hooks or changing OS behavior).Testing and cautions: test on every target Windows version, multi-monitor setups, and with different privilege levels. Avoid creating a denial-of-service where users cannot regain control; always provide an admin override. If considering kernel drivers or winlogon hooks, involve experienced driver developers and follow Microsoft signing and security guidance.
Jump to Post— zachattack05 70Could you open a form with no border and set it to "maximize" on open and make it semi-transparent. Open the form(s) that the user must interact with on top of the semi-transparent form and when they are finished interacting with it, close the form with no border.
If …
Could you open a form with no border and set it to "maximize" on open and make it semi-transparent. Open the form(s) that the user must interact with on top of the semi-transparent form and when they are finished interacting with it, close the form with no border.
If you want to truly do that though, you would need to also capture certain keystrokes that the user could use to defeat it. The Windows Logo key, Alt+Tab as well etc...never tried it but it doesn't sound too complex to do really.
I'll put together an example and post it in a few minutes.
Heres a super simple example of what I'm talking about.
Hope it helps.
There is one key combination you cannot trap unless you write a filter driver and that is "Control+Alt+Delete"
This is a "security" measure by Microsoft. Supposedly it lets the user know that by pressing CAD they are "truly" at a Windows login page or performing a "real" Windows task. So unless your administrator locks down the use of CAD, then they will always be able to get out using that method.
Very true. Even if you could filter that one, I would leave it be.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.