How do you write a program close every open application

Click For Summary
SUMMARY

This discussion focuses on creating a program to close all open applications on a computer, with a specific emphasis on allowing certain applications to remain open. The user is familiar with batch scripting, C++, Java, and Python, and seeks a method to close only applications with a main window. Suggestions include hooking into the execution pipeline or registering for execution events to manage application behavior. The conversation also raises ethical concerns regarding the potential misuse of such functionality.

PREREQUISITES
  • Understanding of process management in operating systems
  • Familiarity with programming languages: C++, Java, Python
  • Knowledge of event-driven programming concepts
  • Basic understanding of application lifecycle management
NEXT STEPS
  • Research how to implement process hooks in C++
  • Learn about event handling in Java for application execution
  • Explore Python libraries for process management, such as psutil
  • Investigate ethical implications of application control mechanisms
USEFUL FOR

Software developers, particularly those interested in process management and application control, as well as security professionals evaluating the implications of application locking mechanisms.

rp.beltran
Messages
4
Reaction score
0
I am trying to make a program that locks a computer unless you have a password by systematically looping through and closing applications. It would also have a list of applications that the user is ok with having open, (for example a dock like rocket dock or a desktop tool like konfabulator or Rain meter). I know how to close individual processes in batch, but is their a way to only close things with a main window? If there is an easier way to achieve the same effect (such as if you can block all programs from ever opening) feel free to say that too. I am most familiar with batch, c++, java, and python, but if another language makes something easier, I am willing to try it.Thanks!
 
Technology news on Phys.org
Hey rp.beltran and welcome to the forums.

From what you are describing I guess you are talking about linux which I don't know too much about.

But to answer your question, you should see if you can either a) hook the execution pipeline to load new executables or b) if you can register to get events on something being executed then you can either send a response to deny it (if you can) or to just shut it down yourself in your program.

Personally, the idea of having this functionality is not a good thing. I really wouldn't want standard application developers to be able to do something like this, but those are two ideas.
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 4 ·
Replies
4
Views
8K
Replies
5
Views
8K
  • · Replies 7 ·
Replies
7
Views
13K