So I'm writing a personal program right now that basically I want it to help keep me from getting distracted when at school or work, essentially letting me only access the programs that I need when at those places.

My question is, whenever a program comes up in windows 7 that needs admin approval first, the request for approval comes up and locks out everything but that.
Would it be possible for me to do that with my program?
How would I access it?
If it can't be done in C++ but can be done in another language, what would it be?

5 Years
Discussion Span
Last Post by doug65536

noone will help you to do such a program because your purpose of using it is just stupid.
it's like you would want to keep yourself tied when you know how to escape

Edited by dospy: n/a


What windows is doing when that thing comes up is switching to another desktop. The "other" desktop is heavily secured so that it is very very difficult* for a program to be able to press the button for you (by moving the mouse pointer and clicking it from a malicious program).

* (but not impossible, nothing is truely impossible in a computer, because no software is completely perfect. Even if you did have perfect software, people aren't perfect, they leak passwords, etc)

I would not try to accomplish something like UAC. You could make it simpler and scan for "blacklisted" processes. In C# it's pretty easy to get the list of programs from WMI. You could enumerate win32_process instances and terminate blacklisted programs.

The problem is, you would simply kill the watchdog program, fire up your game and play it anyway. You would need to run your program as a service (to protect it from you disabling it from your limited account), and take away administrative privileges from yourself. You would need someone you trust to enforce your behavior who has admin privileges.

That's one approach anyway. Perhaps you could save the time you spend on this project and simply discipline yourself to work/study.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.