DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: DONE: Program closer  (Read 14,952 times)

m_s

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 433
DONE: Program closer
« on: November 14, 2005, 11: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?

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,073
    • Cody Award
    • Furry Fandom Badge - Furry Fandom
Re: Program closer
« Reply #1 on: November 15, 2005, 01:14 AM »
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


Code
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
« Last Edit: November 15, 2005, 11:38 AM by CarolHaynes »

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,217
Re: Program closer
« Reply #2 on: November 15, 2005, 09: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!


skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: Program closer
« Reply #3 on: December 01, 2005, 01:43 PM »
:) My program CloseMany should do many of the things you ask for.

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

Skrommel

m_s

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 433
Re: Program closer
« Reply #4 on: December 01, 2005, 01:59 PM »
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?

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: Program closer
« Reply #5 on: December 01, 2005, 03:09 PM »
:-[ Others (hi Carol!) have also reported this problem. I am planning to make a new version with an external processviewer.

Skrommel

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: Program closer
« Reply #6 on: December 02, 2005, 01:12 AM »
:) 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

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,073
    • Cody Award
    • Furry Fandom Badge - Furry Fandom
Re: Program closer
« Reply #7 on: December 02, 2005, 12:18 PM »
Works for me now - has this been posted in two threads - I'm sure I just read this?

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
Re: Program closer
« Reply #8 on: December 04, 2005, 07: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, by Micrologics (free!) .. .it works quite well for this purpose!!  :Thmbsup:

m_s

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 433
Re: Program closer
« Reply #9 on: December 04, 2005, 08:27 PM »
THAT is fantastic - thank you LuckMan!

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: DONE: Program closer
« Reply #10 on: May 19, 2006, 12:37 AM »
:) Just updated CloseMany to v2.3, removing yet another dependency of an external program.

Skrommel

Original address: https://www.donationcoder.com/forum/index.php?topic=1509.0