Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Wanting to prevent my app from being closed using Task Manager

  1. #1
    Member
    Join Date
    Nov 2009
    Posts
    57
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Wanting to prevent my app from being closed using Task Manager

    Hi

    I have created an app that needs to run in the backgroud all of the time (it monitors idle time of pc's for usage stats) but I want to stop this app/process from being closed using task manager.

    I have tried various packages to wrap the JAR file up (Advanced Installer) so that you can just run the .exe it creates without seeing that Java.exe is running. Advanced Installer also allows you to create a service from a java application but I cannot get this to work as the application does interact with the desktop (shows windows balloon messages).

    Has anyone prevented this in the past, if so advice would be appreciated.

    I have seen certain programs such as antivirus programs which when you try and terminate the process using task manager it either comes up access denied or it will respawn a new process so it can never be closed and I would like to replicate this.

    I have full administrator / domain administrator access over the pcs it will be used on as well as access to group policy.

    Thanks


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Wanting to prevent my app from being closed using Task Manager

    This is a pretty shifty thing to want to do, and Java will probably not make it easy for you. You've mentioned two approaches. Have you attempted either one?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Member
    Join Date
    Nov 2009
    Posts
    57
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Re: Wanting to prevent my app from being closed using Task Manager

    I tried the service but I cannot get it to launch properly, it seems to be running in the background but it doesnt interact with desktop and I have also tried making the service run as the logged on user and an administrator which still doesnt work.

    The exe file runs but you can still terminate the process using task manager so that also doesnt work.

  4. #4
    Member
    Join Date
    Nov 2009
    Posts
    57
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Re: Wanting to prevent my app from being closed using Task Manager

    ok, have had to create a silent service which then communicates with a GUI front end so if they close the gui the service is still running in the background.

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Wanting to prevent my app from being closed using Task Manager

    How does that stop the user from killing your service? What if they kill Java?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    Member
    Join Date
    Nov 2009
    Posts
    57
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Re: Wanting to prevent my app from being closed using Task Manager

    Because the service runs java as Local System and a normal user cannot end a task that has been started as another user so this prevents any normal user from ending the process.

Similar Threads

  1. prevent all possibilities of resizing jframe
    By xchan in forum AWT / Java Swing
    Replies: 1
    Last Post: July 27th, 2013, 03:32 PM
  2. Prevent object going outside of screen?
    By JakkyD in forum Java Theory & Questions
    Replies: 2
    Last Post: May 7th, 2012, 10:56 AM
  3. task manager
    By sayed shah in forum Object Oriented Programming
    Replies: 1
    Last Post: April 27th, 2012, 04:15 PM
  4. Replies: 3
    Last Post: December 21st, 2011, 03:46 PM
  5. Um, ya, wanting to do a little more than my program can take
    By aussiemcgr in forum Java Theory & Questions
    Replies: 5
    Last Post: September 3rd, 2010, 04:36 PM