Member Avatar for mnorgate

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#?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.