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