Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 01, 2015, 01:00:39 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Ability to set certain programs/windows to open and close in unison  (Read 15582 times)

aidan_cage

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 27
    • View Profile
    • Donate to Member
hello
I'm looking for a small program that would allow me to set certain programs, or a program and a window, or certain windows to open and close in unison
my example for a service like this would be to open my music player, which is set to open Last.fm simultaneously, then to close BOTH when I close one

as things are, I don't need Last.fm to be running unless I am scrobbling my listened to tracks to my profile, which I am only doing when I am running my music player.  I'd like to be able to kill both programs when I close my music player.

Likewise, I'd love to kill Live Messenger when I click to close it.
sigh, it is beyond me

thanks, Tristan
« Last Edit: November 17, 2007, 03:28:04 AM by brotherS »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,963
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #1 on: November 18, 2007, 12:57:32 AM »
not a bad idea.

aidan_cage

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 27
    • View Profile
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #2 on: December 05, 2007, 04:55:49 PM »
it seems to be more difficult than I first thought...
It is more something that I'd like to have, than something I am able to create right now :(

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #3 on: December 05, 2007, 11:38:09 PM »
Likewise, I'd love to kill Live Messenger when I click to close it.

i could help you with this but i can't understand certain things such as:

1. how does Last.fm operates? (not a Last.fm user)
2. do you mean to say that you can't exit Live Messenger normally?

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #4 on: December 06, 2007, 07:30:21 AM »
@ live messenger: when u use the close button on the interface it minimizes instead, you have to right click the tray icon and choose Exit.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #5 on: December 06, 2007, 09:13:54 PM »
exactly, that's why i thought he was having problems with exiting Live Messenger..

ws-exit-msn-live.png

aidan_cage

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 27
    • View Profile
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #6 on: December 14, 2007, 09:08:45 AM »
aHa!  Exactly.  I have been using Nobar for a little while to hide my taskbar.  In this way it takes an extra step for me to close applications that refuse to close via their on screen windows.  WLM is one of them, and LastFM is another.  LastFM opens automatically when I launch my music software, but when I choose to quit the music software, LastFM remains open in the sidebar--waiting. 

I think that I can make individual shortcuts to batch files that run shortcuts and scripts to accomplish this task, but I would really like a simple layout program that can accomplish this.

http://cybernetnews....cesses-and-programs/

I found this site to have some information.
So I guess I could set up single instance shortcuts that I could launch to terminate a couple programs at one time.
I guess it will do.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #7 on: December 16, 2007, 06:25:18 PM »
or you can use Farr instead which comes with a plugin called ProcessKill. This plugin when invoked will show a list of running processes and you can choose which one to kill..

ws-farr-plugin-pkill.png

aidan_cage

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 27
    • View Profile
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #8 on: December 16, 2007, 06:42:46 PM »
this makes me feel even sillier for having paid into Dash Command
FARR would do that for me? awww, how sweet.
That would be an easy way to deal with things.  I guess I was originally thinking of a small program with a GUI similar to Tooler that would allow processes to be paired and unpaired, closed and opened.  Thanks for the info on FARR, I'll have to give it a try.  It would still require the conscious steps of my thinking about closing the programs when they're open.  It seems to also require steps, and maybe more steps than just running Nobar.exe, then right clicking the offending programs to close them.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #9 on: December 16, 2007, 07:01:31 PM »
in addition to plugins, Farr also supports aliases.. take a look at this thread for more usage example: FARR V2 core alias tables.

if you want a single script that toggles open/close state then a Autohotkey script similar to this can do the trick..
Code: [Select]
;Run metapad only if it is not already started
Process, Exist, metapad.exe
If ErrorLevel = 0
  Run, C:\Program Files\metapad\metapad.exe
Else  ;close the app
  WinClose, ahk_class metapad
Return

aidan_cage

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 27
    • View Profile
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #10 on: December 16, 2007, 08:35:22 PM »
that's a little above my learning, but I'm curving up there
Thanks for the ideas, I'll continue to read, learn, and implement
PEACE

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #11 on: December 16, 2007, 08:56:37 PM »
a good idea but i did some googling & came up with this script. you can create a shortcut from this script with the related parameter and call it from Farr..

ws-exit-messenger.png
Exit Messenger 1.1

also let me know if you need any other help..

aidan_cage

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 27
    • View Profile
    • Donate to Member
Re: IDEA: Ability to set certain programs/windows to open and close in unison
« Reply #12 on: December 17, 2007, 06:19:02 PM »
hey!  thanks for helping me out with that!
I found a program that works well for my needs and purposes
http://www.nirsoft.net/utils/nircmd.html
Nircmd.exe
I can throw arguments at it and it will bend my wants to my will to my computer's processes
Thanks, and I hope someone else finds it useful
« Last Edit: December 18, 2007, 02:30:37 PM by aidan_cage »

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,708
    • View Profile
    • Donate to Member
Hi Lanux. I just bumped on that thread, looking for an easy way to close/start a bunch of apps. Your little AHK script seems like it should do fine. But I'm struggling to find the windows class names. How can I find them ? Thanks.  :)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Armando, you can use the "AU3 Spy" program that is available with Autohotkey. here, in the screenshot you can see how it shows the ahk_class of Process Explorer. there are plenty of other tools as well, i'll go digging in the threads if you want. :)

ws-Au3Spy.png

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,708
    • View Profile
    • Donate to Member
Perfect. Thanks a lot Lanux. You don't have to do more work.  :) I'll see what I can do with that.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
ok, let me know if you need anything else. btw, congrats on your 1500th post. 8)

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • gravatar avatar
  • Posts: 2,856
    • View Profile
    • Donate to Member
you can use the "AU3 Spy" program that is available with Autohotkey.

Lanux128,

Is there a direct way to save the AU3 Spy information to a file?  Or do you just have to run the mouse over the AU3 Spy window to mark the text and save it via the clipboard?


lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,218
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
rjbull: normally i just use Shift+Alt+Tab between the program that i want to check on with AU3 Spy then it's all the usual copy-paste at work. a quick tip: when AU3 Spy gets focus, you can press the down key to select all text.

another good alternative is AHK Window Info 0.9 which is being actively developed by toralf at the AHK forums.

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Donate to Member
Likewise, I'd love to kill Live Messenger when I click to close it.
I gave it a shot :
Code: [Select]
;; Kick messenger
;; by ak

~LButton::
SetBatchLines, -1
CoordMode, Mouse, Screen
SetMouseDelay, -1
SetKeyDelay, -1
MouseGetPos, ClickX, ClickY, winID

Wingetclass winClass, ahk_id %winID%
Winget winPID, PID, ahk_id %winID%

if (winClass != "MSBLWindowClass")
  return
if IsOverCloseButton(ClickX, ClickY, winID)
  Process close, %winPID%
return

IsOverCloseButton(x, y, hWnd)
{
   SendMessage, 0x84,, (x & 0xFFFF) | (y & 0xFFFF) << 16,, ahk_id %hWnd%
   return (ErrorLevel == 20)
}

It works on my computer. It kills Live Messenger's process when you click its close button. The only problem with killing the process is that Messenger's tray icon stays visible (until you hover it with your mouse). At least that's what it does on my XP.

EXE version here :

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,708
    • View Profile
    • Donate to Member
Interesting.

I tried the lazy way... I decided to use the "ReRun" AHK application by skromel (reruns any atart up application that's not running). Unfortunately, I ran into a BSOD. My guess is that rerun tried to rerun some already runing programs (like my firewall : Online Armor) -- and gave me all kinds of errors before finally BSODing.

Anyhow, I'm still trying to find an easy way to stop or pause a bunch of apps while my laptop is on battery power, and (semi manually) restart them all as soon as I replug it. If I don't find anything, I might just try writing a little script with everything that's been proposed in this thread. The problem is of course to close these applications that need to be closed via the system tray (or else... they won't close)... I guess I could also use some kind of safe  AHK  "kill" command directly on the processes -- will  have to do some research.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • gravatar avatar
  • Posts: 2,856
    • View Profile
    • Donate to Member
when AU3 Spy gets focus, you can press the down key to select all text.

Thanks!  I didn't know that.  DC's a great place for sharing know-how  :)

Quote
another good alternative is AHK Window Info 0.9 which is being actively developed by toralf at the AHK forums.

Thanks again...  I sometimes use ShoWin or WinScraper, but they don't always work.  The Window Info built into PowerPro also doesn't have a way of saving the data automatically, thought there's a script to do it that I haven't tried.


Fred Nerd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 278
    • View Profile
    • Donate to Member
Quote
The only problem with killing the process is that Messenger's tray icon stays visible (until you hover it with your mouse). At least that's what it does on my XP.
Common problem with XP, I often end up with tray icons which have to be moused away. Once ended up with 3 network connections when only one was running (and slowly at that :)