AutoHotkey Community

It is currently May 27th, 2012, 1:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: February 14th, 2010, 6:12 pm 
Offline

Joined: September 10th, 2009, 5:54 pm
Posts: 203
I found part of your script very useful, how to exit utorrent via right click on tray icon.
But I couldn't replicate the same to other program called "Newsleecher", any idea?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 21st, 2010, 5:15 pm 
Offline

Joined: January 29th, 2009, 9:50 pm
Posts: 483
Location: Belgium
the screensaver
same result shorter code
Code:
#notrayicon
Loop, %0%   ; if no commandline no loop is donne so
   {
   if %A_Index% contains s,S
      Goto Butts
   else if %A_Index% contains c,C
      MsgBox, , Idle Torrent, No options here`, duderino!
   break   ; we don't want a second loop anyway
   }
ExitApp   ; gues the commandline wasnt good
Butts:
;running the program twice is the only way to make sure the window's open and not trayed
;this is necessary for the process close function to work, otherwise it doesn't.
Run, "C:\Program Files\uTorrent\uTorrent.exe" /BRINGTOFRONT
Sleep, 2000
Run, "C:\Program Files\uTorrent\uTorrent.exe" /BRINGTOFRONT
Sleep, 2000
Run, "C:\Windows\System32\Mystify.scr" /s

;for when UT has been started - watch for activity to prompt user to kill it
while (A_TimeIdlePhysical > 1100) {   ; if we are just doing nothing
   Sleep, 1000                     ; sleeep
   }
MsgBox ,4,Good morning!,Do you want to exit uTorrent now?
IfMsgBox No
    ExitApp
else {
   Process, Exist, utorrent.exe ; <<hey Gauss, pay attention here
   PostMessage, 0x12, , , , ahk_pid %ErrorLevel%
   ExitApp
   }


actualy this options will never work, becouse normaly
config is "%1"
run is "%1" /S
and install is rundll32.exe desk.cpl,InstallScreenSaver %l

then we would want to use:
Code:
#notrayicon
if %1% {   ; if the commandlineitem exist
   if 1 contains /s,/S   ; and its to launch
      Goto Butts
   else msgbox, no valid commandline   ; for a invalid commandline
} else MsgBox, , Idle Torrent, No options here`, duderino!   ; if no commandline show options
ExitApp   ; gues the commandline wasnt good
Butts:
;running the program twice is the only way to make sure the window's open and not trayed
;this is necessary for the process close function to work, otherwise it doesn't.
Run, "C:\Program Files\uTorrent\uTorrent.exe" /BRINGTOFRONT
Sleep, 2000
Run, "C:\Program Files\uTorrent\uTorrent.exe" /BRINGTOFRONT
Sleep, 2000
Run, "C:\Windows\System32\Mystify.scr" /s
;for when UT has been started - watch for activity to prompt user to kill it
while (A_TimeIdlePhysical > 1100) {   ; if we are just doing nothing
   Sleep, 1000                     ; sleeep
   }
MsgBox ,4,Good morning!,Do you want to exit uTorrent now?
IfMsgBox No
    ExitApp
else {
   Process, Exist, utorrent.exe   ; <<hey Gauss, pay attention here
   PostMessage, 0x12, , , , ahk_pid %ErrorLevel%
   ExitApp
   }

_________________
Stopwatch emdkplayer
the code i post falls under the: WTFYW-WTFPL license


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group