Welcome Guest.   Make a donation to an author on the site October 25, 2014, 07:20:42 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2011! Download 30+ custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: Movie Mode  (Read 5155 times)
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,278



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: December 08, 2010, 01:48:27 PM »

Whenever my daughter and I watch movies on my PC (or I am playing a fullscreen game), I end up having to first close a bunch of applications I normally have running, because they either make sounds or have popup alerts that distract us and spoil our enjoyment of the movie.

It would be nice if I had utility that I could supply a list of the full paths to all the programs that interfere, that may or may not be running. It would go down the list and check if those apps are running; and if they are, add them to a relaunch list before closing them. Then when I am finished watching my movie, it could relaunch all the apps for me...but only the ones on the relaunch list. This way nothing that wasn't running before would end up getting launched, and I could provide a more extensive list of applications that interfere.

NOTE: At least one of the applications I need to close has to be relaunched with command line parameters.
Logged

JavaJones
Review 2.0 Designer
Charter Member
***
Posts: 2,537



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: December 09, 2010, 02:17:27 AM »

Would it not be easier to have something that mutes all apps but the foreground one (movie player) and is "always on top"? Seems that might also be fairly easy to code and more generally useful.

- Oshyan
Logged

The New Adventures of Oshyan Greene - A life in pictures...
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,278



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: December 09, 2010, 05:30:38 AM »

No, because it's not only sound that causes distractions. Popup alerts and other activities also cause distractions.

This would be fairly easy to code as I described it, and normally it would be the kind of thing I'd make myself, but I am just not in the right frame of mind to be able to do it.
Logged

mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: December 09, 2010, 08:29:37 AM »

I would be willing to add such a feature to Process Tamer.
Logged
JavaJones
Review 2.0 Designer
Charter Member
***
Posts: 2,537



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: December 09, 2010, 11:12:42 PM »

Yeah, I figured the "always on top" bit would take care of the pop-ups. But fair enough. I guess a better way to say it is *I'd* find a more general version to be useful. But I don't want to hijack your request thread. smiley

- Oshyan
Logged

The New Adventures of Oshyan Greene - A life in pictures...
Target
Honorary Member
**
Posts: 1,410



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: December 09, 2010, 11:21:47 PM »

could any of the offending apps suffer data loss on being closed?
Logged

"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,278



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: December 09, 2010, 11:29:14 PM »

could any of the offending apps suffer data loss on being closed?

No.
Logged

superboyac
Charter Member
***
Posts: 5,705


Is your software in my list?

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: December 10, 2010, 12:15:44 AM »

Just to be sure, before it relaunches the programs, it should check to make sure the programs are not already running.  You may have closed a program without realizing you just minimized it to the tray, or there was some dialog that you had to click on before closing.
Logged

lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: December 25, 2010, 10:55:10 PM »

i have a script to do this before launching a game but the apps to be closed/relaunched are manually added to the list. that's why there is a "pre" and "post" button. i'll clean up the code a bit and post it if you're interested.

Logged

SleepingWolf
Supporting Member
**
Posts: 104


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: February 07, 2011, 10:54:04 AM »

You could check out EndItAll by PC Magazine at pcmag.com
Logged

-------------------------------------------

Choose life -or at least respect it.
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,278



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: February 07, 2011, 12:45:17 PM »

You could check out EndItAll by PC Magazine at pcmag.com

Thanks for the suggestion but...

Here are the 2 key points to what I want:

  • I do not want to have to select a bunch of things to kill each and every time.
  • I need it to be able to restart everything it kills later on.

EndItAll can not do that and neither can its successor, TaskPower 2.
Logged

4wd
Supporting Member
**
Posts: 3,355



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: February 07, 2011, 04:50:58 PM »

Annoyed with constant popup requesters from people who want to be your Facebook friend?
Find that the latest Nigerian Prince has interrupted your movie watching by offering you a once in a lifetime offer to get wealthy?
Do dings, bells, chimes and buzzes make you miss that once in a million Call of Duty: Black Ops headshot?
Constantly find yourself openning the door for salesmen?  (Sorry, got carried away  embarassed )

Well, your prayers are answered!*

Try ***Movie-ize***, (catchy name, huh).

Comes with a money back guarantee!**

Instructions:
1) Put it anywhere
2) Run it
3) Marvel at the Tray icon
3) Select Preferences to edit the ini file, it's pretty self-explanatory: one line per program, full path required, increment the key number as you go, (ie. Program11, Program12, etc).  It throws Skype in as an example entry.

I should note that all it does is close the process, if the process pops up a requester asking for confirmation, it won't get it from this program.

EDIT: Crap!  Didn't see the command line parameter bit  embarassed
I'll have a look at that.  Can you send me an example command line for it?

Removed, see post below.


* Maybe
** Disclaimer: All waranties void if this software proves useful or not.  Liability also not accepted for damage to eyesight through increased movie watching or DVT from failing to move from chair.  Warranty also considered to be void if it's used on a system it wasn't designed for, ie. mine.
« Last Edit: February 07, 2011, 08:35:27 PM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,278



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: February 07, 2011, 06:19:45 PM »

Can you send me an example command line for it?

This is the parameters for launching the particular version of xchat that I run, that sets the settings folder somewhere other than the default location on my system drive:

-d "E:\Programs Installed\xchat-pu70\settings"
Logged

4wd
Supporting Member
**
Posts: 3,355



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: February 07, 2011, 06:38:48 PM »

Thanks, got an idea how to go about it - other than that, is it suitable for intended purpose?

eg. The method it uses to kill programs tends to leave their icons in the SysTray until you wander your mouse over them, is this a problem?

Of course, if it is a problem I don't know what I'm going to do about FIXED

While I'm at it, when running programs from command line do you want the CLI window to be open/closed/optional ?

EDIT: Try this one.

Delete the old ini file, it'll create a new one with a couple of examples.
Main things to notice are:
1) Prefix DOS, (or CLI run programs), with the '>' character;
2) Match the parameters with the programs, ie. Param1 is for Program1, etc;

Oh, if it wasn't obvious in the first post, it can handle more than 10 programs - just keep incrementing the program and parameter number.
« Last Edit: March 07, 2011, 01:00:52 PM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,278



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: February 08, 2011, 01:02:48 AM »

The method it uses to kill programs tends to leave their icons in the SysTray until you wander your mouse over them, is this a problem?

Sounds good to me so far and the tray icons won't be a problem.

While I'm at it, when running programs from command line do you want the CLI window to be open/closed/optional ?

There is no extra CLI window when I launch XChat that way.

other than that, is it suitable for intended purpose?

Can't answer that yet, but I'll configure and test this later, when I am fully awake and not busy. (woke up to a ton of work in my inbox)

Logged

4wd
Supporting Member
**
Posts: 3,355



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: February 08, 2011, 01:24:45 AM »

Sounds good to me so far and the tray icons won't be a problem.

I'm afraid I fixed that, so you'll have to download it again from above post  embarassed

I also gave it an obligatory random version number so I can keep up with myself.

Quote
There is no extra CLI window when I launch XChat that way.

Oh well, I've left in the option of leaving the output window open.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,278



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: February 08, 2011, 09:42:05 AM »

The closing of everything works great.

The relaunching has an issue: nothing with command line parameters is being relaunched.
Logged

4wd
Supporting Member
**
Posts: 3,355



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: February 08, 2011, 05:04:21 PM »

The relaunching has an issue: nothing with command line parameters is being relaunched.

Could you post or PM the ini file, (blank anything you don't want seen) ?

Ah, I think my handling of quotes was a little skewiff.

Try this one, it seems to work OK with the specific example you gave above - might need to rework it for more complicated quoting.

Have also removed the option to leave open the output CLI, (just to make the parameters in the ini file a little simpler), but if anyone wants it back, say something.

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. ; Filename: Movie-ize.au3
  2. #NoTrayIcon
  3. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  4. #AutoIt3Wrapper_icon=popcorn-32x32.ico
  5. #AutoIt3Wrapper_UseUpx=n
  6. #AutoIt3Wrapper_UseX64=n
  7. #AutoIt3Wrapper_Res_Icon_Add=popcorn-32x32.ico
  8. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  9.  
  10. #include <_SysTray.au3>
  11. #include <Process.au3>
  12. #include '_OsVersionInfo.au3'
  13.  
  14. Global $inifile = 'Movie-ize.ini', $tempini = 'Movie-tmp.ini', $_state = False, $_term = False
  15.  
  16. ;--- Start Tray menu stuff
  17. Opt("TrayMenuMode", 1)
  18. Opt("TrayOnEventMode", 1)
  19.  
  20. $movieon = TrayCreateItem('Movie-ize',-1,-1,1)
  21. TrayItemSetOnEvent(-1, '_movieOn')
  22. $movieoff = TrayCreateItem('De-Movie-ize',-1,-1,1)
  23. TrayItemSetOnEvent(-1, '_movieOff')
  24. $prefs = TrayCreateItem('Preferences',-1,-1,0)
  25. TrayItemSetOnEvent(-1, '_prefs')
  26. $about = TrayCreateItem('About',-1,-1,0)
  27. TrayItemSetOnEvent(-1, '_about')
  28. $exit = TrayCreateItem('Exit',-1,-1,0)
  29. TrayItemSetOnEvent(-1,'_Exit')
  30. TraySetIcon('Movie-ize.exe', 4)
  31. TraySetToolTip("Get out the popcorn 'cause it's movie time!")
  32. TrayItemSetState($movieoff, 129)
  33. TrayItemSetState($movieon, 64)
  34. ;--- End Tray menu stuff
  35.  
  36. If Not FileExists($inifile) Then
  37. _CreateBaseIni()
  38. $kill = IniReadSection($inifile, 'Programs')
  39. $kparam = IniReadSection($inifile, 'Parameters')
  40.  
  41. If $CmdLine[0] > 0 Then $_term = True
  42. If $_term Then
  43. _RunAndExit()  ;--- If there's a CLI argument then Run and Exit
  44. _Initialise()  ;--- Otherwise, check for Movie-tmp.ini and initialise to movieOn state
  45.  
  46. Sleep(1000)    ;--- Twiddle thumbs
  47.  
  48.  
  49. Func _Initialise()
  50. If FileExists($tempini) Then
  51. $xterm = IniReadSection($tempini, 'Start')
  52. For $i = 1 To $kill[0][0]
  53. $kill[$i][0] = $xterm[$i][1]
  54. $_state = True
  55. TrayItemSetState($movieon, 129)
  56. TrayItemSetState($movieoff, 68)
  57. TrayItemSetState($prefs, 128)
  58. TraySetToolTip('System Movie-ized')
  59.  
  60. Func _Exit()  ;--- If not Run And Exit, checks to see if in MovieOn mode and asks user if they really want to exit
  61. If Not $_term Then
  62. TrayItemSetState($exit, 4)
  63. If $_state And (MsgBox(49, 'Movie-ize', 'System currently Movie-ized!' & @CRLF & 'Do you want to quit in this state?') = 2) Then Return
  64.  
  65. Func _about()
  66. TrayItemSetState($about, 4)
  67. MsgBox(64, 'Movie-ize', 'Movie-ize v0.22')
  68.  
  69. Func _prefs()  ;--- Load the ini into users default editor and wait for exit, then re-read ini
  70. TrayItemSetState($prefs, 4)
  71. If Not $_state Then  ;--- If in MovieOn mode then killed program state will be lost if user edits ini....so don't! >:^(
  72. ShellExecuteWait($inifile)
  73. Sleep(1000)
  74. $kill = IniReadSection($inifile, 'Programs')
  75. $kparam = IniReadSection($inifile, 'Parameters')
  76. MsgBox(48, 'Movie-ize', 'System currently Movie-ized,' & @CRLF & 'Preferences will be unavailable.')
  77.  
  78. Func _movieOn()  ;--- Cycles thru program array, if there's a process match it kills it and sets corresponding element to 1
  79. Local $i, $guineapig
  80. If Not $_term Then
  81. TrayItemSetState($movieon, 129)
  82. TrayItemSetState($movieoff, 64)
  83. TrayItemSetState($prefs, 128)
  84. $_state = True
  85. For $i = 1 To $kill[0][0]
  86. If $kill[$i][1] <> '' Then
  87. $guineapig = StringMid($kill[$i][1], StringInStr($kill[$i][1], '\', 0, -1) + 1)
  88. If ProcessExists($guineapig) Then
  89. ProcessClose($guineapig)
  90. $kill[$i][0] = 1
  91. $kill[$i][0] = 0
  92. _RefreshSystemTray()
  93. If Not $_term Then TraySetToolTip('System Movie-ized')
  94.  
  95. Func _movieOff()  ;--- Cycles thru program array looking for 1 element, if found tries to restart the associated program
  96. Local $i, $exec, $wdir, $execcmd
  97. If Not $_term Then
  98. TrayItemSetState($movieon, 64)
  99. TrayItemSetState($movieoff, 129)
  100. TrayItemSetState($prefs, 64)
  101. $_state = False
  102. For $i = 1 To $kill[0][0]
  103. If $kill[$i][0] = 1 Then
  104. If StringLeft($kill[$i][1], 1) = '>' Then
  105. $exec = StringMid($kill[$i][1], 2)
  106. $wdir = StringMid($kill[$i][1], 2, StringInStr($kill[$i][1], '\', 0, -1) - 2)
  107. $execcmd = '"' & $exec & '" ' & $kparam[$i][1]
  108. Run(@ComSpec & ' /c "' & $execcmd & '"', $wdir, @SW_HIDE)
  109. Run($kill[$i][1])
  110. Sleep(500)
  111. If Not $_term Then
  112. TraySetToolTip("Get out the popcorn 'cause it's movie time!")
  113. FileDelete($tempini)
  114.  
  115. Func _CreateBaseIni()  ;--- Creates a basic ini file first time it's run
  116. Local $i
  117. IniWrite($inifile, 'Programs', 'Program1', 'C:\Program Files\Skype\skype.exe')
  118. IniWrite($inifile, 'Programs', 'Program2', '>C:\Program Files\xchat\xchat.exe')
  119. IniWrite($inifile, 'Parameters', 'Param1', '')
  120. IniWrite($inifile, 'Parameters', 'Param2', '-d "E:\Programs Installed\xchat-pu70\settings"')
  121.  
  122. Func _TempIni()  ;--- For Run And Exit, writes a temporary ini file with initial program states, (QaD)
  123. Local $i
  124. For $i = 1 To $kill[0][0]
  125. IniWrite($tempini, 'Start', 'Start' & $i, $kill[$i][0])
  126. IniWrite($tempini, 'Programs', 'Program' & $i, $kill[$i][1])
  127. IniWrite($tempini, 'Parameters', 'Param' & $i, $kparam[$i][1])
  128.  
  129. Func _RunAndExit()  ;--- If the temporary ini exists, assumes already run once and refills array with correct values before calling _movieOff
  130. Local $i        ;--- otherwise call _movieOn then _TempIni to write list of killed programs
  131. If FileExists($tempini) Then
  132. $xterm = IniReadSection($tempini, 'Start')
  133. $kill = IniReadSection($inifile, 'Programs')
  134. $kparam = IniReadSection($inifile, 'Parameters')
  135. For $i = 1 To $xterm[0][0]
  136. $kill[$i][0] = $xterm[$i][1]
  137. _movieOff()
  138. FileDelete($tempini)
  139. _movieOn()
  140. _TempIni()
  141. _Exit()
  142.  
  143. Func _RefreshSystemTray()  ;--- The magic that clears the SysTray of dead icons courtesy of a UDF by Tuape & Erik Pilsits
  144. $count = _SysTrayIconCount()
  145. For $i = $count - 1 To 0 Step -1
  146. $handle = _SysTrayIconHandle($i)
  147. $visible = _SysTrayIconVisible($i)
  148. $pid = WinGetProcess($handle)
  149. $name = _ProcessGetName($pid)
  150. $title = WinGetTitle($handle)
  151. $tooltip = _SysTrayIconTooltip($i)
  152. If $pid = -1 Then _SysTrayIconRemove($i)
  153.  
  154. If _OsVersionTest($VER_GREATER_EQUAL, 6, 1) Then
  155. $countwin7 = _SysTrayIconCount(2)
  156. For $i = $countwin7 - 1 To 0 Step -1
  157. $handle = _SysTrayIconHandle($i, 2)
  158. $visible = _SysTrayIconVisible($i, 2)
  159. $pid = WinGetProcess($handle)
  160. $name = _ProcessGetName($pid)
  161. $title = WinGetTitle($handle)
  162. $tooltip = _SysTrayIconTooltip($i, 2)
  163. If $pid = -1 Then _SysTrayIconRemove($i, 2)

UPDATE: v0.22 - Cleaned up some stupid typos, removed some stuff that I forgot.
                        - Now sets the tray menu items to disabled/enabled so you don't call things twice, (why didn't I think of that before?).
                        - Added ability to run and exit, just call it with a command line argument (writes a temp ini when it kills programs, deletes it after relaunching them).
                        - Added some comments to source, ('cause mouser told me I should).

* Movie-ize022.zip (326.72 KB - downloaded 96 times.)
« Last Edit: February 09, 2011, 02:27:32 AM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,278



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: February 08, 2011, 07:42:55 PM »

Thank you! That works.  smiley
Logged

4wd
Supporting Member
**
Posts: 3,355



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: February 08, 2011, 07:55:20 PM »

Thanks April, source added to post above.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.235s | Server load: 0.15 ]