Click here to Skip to main content
15,918,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am making my own custom user password. When I start up windows my program prompts the user for the password. If the person does not get it correct after a few tries then the computer shuts down. I have a problem, I want to make the program lock the screen until the code is correct.

Fore example, when the computer starts up a window appears prompting the user to put in the code. Until the user puts in the correct code he is unable to access anything form the computer like whenever you get an error in windows and it wont allow you to do anything else no matter where or how many times you click on the background.

I will appreciate the help, this project is for educational purposes so please don't say it is invented already or why I don't just use the regular login.

Thanks,

operating system windows 7

visual C#
Posted

1 solution

Off the top of my head, I can think of a couple of ways to achieve this, but you're going to have a problem in that the user may be able to kill your application using the task manager. Most people have a policy, here on Code Project, in not providing an answer on how to prevent the task manager from being shown because, while your purposes may be good, you aren't the only one who reads this, and we don't want to help people write malicious software.

Saying that, what are the two methods? Well, the first would be to write an application that was set to be always topmost, and that filled the full screen (or screens if you have multiple monitors) - you could make the background semi-transparent to show some of the screen underneath.

The second method takes advantage of the fact that Windows really has multiple desktops. Basically, you'd take a snapshot of your current desktop, create the new desktop, paste your image onto it, and then display your application over the top. Try combining this with the technique above.

In order to create a new desktop, you could read this[^] article.
 
Share this answer
 
Comments
MR. AngelMendez 9-May-12 23:52pm    
thanks your first solution works, I'm using visual C# express 2008 and I wasn't able to create a new desktop. thanks again for your help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900