DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Finished Programs => Topic started by: m_s on November 14, 2005, 05:15 PM

Title: DONE: Program closer
Post by: m_s on November 14, 2005, 05:15 PM
Would it be possible (or does anybody know if somebody has done this already?) to make a program that could sit in the system-tray and which would, on a mouseclick, drop down a list of running processes, so that the user could simple click, say, a red x to close any particular program or process?  Where would this be useful?  Well, I would find it handy for shutting down MS ActiveSync, which runs automatically when I attach my Pocket PC, but which I don't want running all the time (so I have taken it out of my startup progams list); and after ActiveSync has run, it would be useful for shutting down the several stray copies of Outlook that AS spawns...  And I'm sure I would find it useful at many other points in the day.  I know I can do this with Process Explorer - and I do daily - but I'm wondering if there might be a simple, elegant little program that could do it in fewer steps?
Title: Re: Program closer
Post by: Carol Haynes on November 14, 2005, 07:14 PM
If they are specific processes you know are running it should be easy to write an AutoHotKey script to shut them down. Something like this should work for Outlook.exe


Process, wait, Outlook.exe, 1    ; Wait 1 second to see if Outlook.exe exists in the running processes list
NewPID = %ErrorLevel%           ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
{
  MsgBox Outlook Wasn't running anyway
  exit
}


; Otherwise close all running instances of Outlook.exe
MsgBox All instances of Outlook will now be closed
Process, waitclose, Outlook.exe, 5   ; Allow Outlook 5 seconds to close
NewPID = %ErrorLevel%
if NewPID <> 0
 MsgBox One or more instances of Outlook could not be closed
exit

I haven't actually tried this but it is a slightly modified example script from the AHK Help file
Title: Re: Program closer
Post by: rjbull on November 15, 2005, 03:51 AM
a program that could sit in the system-tray and which would, on a mouseclick, drop down a list of running processes, so that the user could simple click, say, a red x to close any particular program or process?  Where would this be useful?  Well, I would find it handy for

Not system tray (use a program launcher like Horst Schaeffer's PopSel or Qsel); but try Taskill by DS Software  http://members.ozemail.com.au/~nulifetv/freezip/freeware/
Quote
 "Taskill v1.02 [6kB]

Taskill is a process viewer and killer. It works in GUI or CLI mode and can kill multiple instances of the same task in one go."

Note the program size: 6kB!

 
Title: Re: Program closer
Post by: skrommel on December 01, 2005, 07:43 AM
 :) My program CloseMany should do many of the things you ask for.

The thread is here: https://www.donationcoder.com/forum/index.php?topic=1288.0 (https://www.donationcoder.com/forum/index.php?topic=1288.0)

Skrommel
Title: Re: Program closer
Post by: m_s on December 01, 2005, 07:59 AM
That looks promising, Skrommel, but I have a problem with it failing to find the Task Manager, probably because I use Sysinternals Process Explorer instead...  Any way of working with this?
Title: Re: Program closer
Post by: skrommel on December 01, 2005, 09:09 AM
 :-[ Others (hi Carol!) have also reported this problem. I am planning to make a new version with an external processviewer.

Skrommel
Title: Re: Program closer
Post by: skrommel on December 01, 2005, 07:12 PM
 :) Try CloseMany v1.2!

It uses two external tools to get the running processes, so please let me know if it works OK.

I've also added a dialog for closing services!

Skrommel

Title: Re: Program closer
Post by: Carol Haynes on December 02, 2005, 06:18 AM
Works for me now - has this been posted in two threads - I'm sure I just read this?
Title: Re: Program closer
Post by: LuckMan212 on December 04, 2005, 01:02 PM
I would find it handy for shutting down MS ActiveSync, which runs automatically when I attach my Pocket PC, but which I don't want running all the time
you may also wish to try ActiveSync Toggle (http://micrologics.co.uk/library/ast/), by Micrologics (free!) .. .it works quite well for this purpose!!   :Thmbsup:
Title: Re: Program closer
Post by: m_s on December 04, 2005, 02:27 PM
THAT is fantastic - thank you LuckMan!
Title: Re: DONE: Program closer
Post by: skrommel on May 18, 2006, 07:37 PM
 :) Just updated CloseMany to v2.3, removing yet another dependency of an external program.

Skrommel