It is currently April 19th, 2024, 11:36 pm

StartMe

Skins that control functions in Windows or Rainmeter
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

StartMe

Post by jsmorley »

A little addon utility to allow you to start an application "minimized" from Rainmeter.

See the example skin for instructions and examples.

Skin requires the latest Rainmeter 3.0 from http://rainmeter.net
StartMe_1.1.rmskin
10-4-2013 11-46-42 AM.png

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=["#@#Addons\StartMe.exe" "C:\Program Files (x86)\Winamp\winamp.exe" "" "Minimize"]
OnCloseAction=["#@#Addons\StartMe.exe" "C:\Program Files (x86)\Winamp\winamp.exe" "Close"]

[Metadata]
Name=StartMe
Author=JSMorley
Information=Demonstration of little addon to start an application with parameter and Minimized/Maximized state. || See StartMe.ini for further instructions.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Oct 2, 2013

[MeasureRunning]
Measure=Plugin
Plugin=Process
ProcessName=winamp.exe
IfAboveValue=0
IfAboveAction=[!SetOption MeterRunning FontColor 153,217,137,255][!SetOption MeterRunning Text "Winamp is running"][!UpdateMeter *][!Redraw]
IfBelowValue=0
IfBelowAction=[!SetOption MeterRunning FontColor 173,173,173,255][!SetOption MeterRunning Text "Winamp is not running"][!UpdateMeter *][!Redraw]

[MeterRunning]
Meter=String
FontSize=14
FontColor=173,173,173,255
AntiAlias=1
SolidColor=47,47,47,255
Padding=5,5,5,5

; Instructions for StartMe.exe

; Format is ["PathToStartMe.exe" "PathAndProgramToStart" "ProgramParameters" "OpenState"]
;LeftMouseUpAction=["#@#Addons\StartMe.exe" "C:\Windows\System32\notepad.exe" "#CURRENTPATH##CURRENTFILE#" "Minimize"]

; Use "Close" as the single ProgramParameters and any open instances of the program will be closed.
; LeftMouseUpAction=["#CURRENTPATH#StartMe.exe" "C:\Windows\System32\notepad.exe" "Close"]

; ProgramParameters and OpenState are optional
; LeftMouseUpAction=["#CURRENTPATH#StartMe.exe" "C:\Windows\System32\notepad.exe"]

; Use "" to leave ProgramParameters blank while specifying OpenState
; LeftMouseUpAction=["#CURRENTPATH#StartMe.exe" "C:\Windows\System32\notepad.exe" "" "Minimize"]

; Values for OpenState are:
; None or "" : Normal, default for program 
; "Hide" : Program starts hidden (caution, you may need to use Taskmanager to close it)
; "Minimize" : Program starts minimized
; "Maximize" : Program starts maximized

; Winamp example:
; LeftMouseUpAction=["#@#Addons\StartMe.exe" "C:\Program Files (x86)\Winamp\winamp.exe" "C:\Users\Jeffrey\Music\G - M\Bob Marley & The Wailers - Legend\Bob Marley & The Wailers - Legend - 06 - Get Up Stand Up.mp3" "Minimize"]
AutoIt code for StartMe.exe (StartMe.au3) is included with the skin.
You do not have the required permissions to view the files attached to this post.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: StartMe

Post by fonpaolo »

Ok, I hope you could be lenient with me... :oops:

I have tested it with... RM 2.5.0 r1842 32 (XP) and 64 (W7 Pro)
I know you said 3.0 but since now I'm using only one computer and it's the main computer I use for my job, I don't install betas on it, even the most stable ones, I use some programs very "sensitive" and I can't do my job without them...

I can assure you that it's working and my problem is that "" used to start the player minimized.

Since I don't use playlists, the player doesn't start untill when I maximize WMP (it's the player I use) and then I minimize it again without touching anything.
I tried it with a playlist but it's the same.

If there's no way to "force" the player to simply play what's on it, maybe filling the "" with a command, a string, a value... I have to find another way, because I want to use it.

As last thought, if it's really caused only because I use the old version... :-(
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: StartMe

Post by jsmorley »

I'm afraid I don't know anything at all about WMP. The intent of StartMe.exe is to close any existing instances of the program in question, and then start it up, passing any parameters you specify to it, just as if you had run it with a shortcut or from the command line.

I close the program first, so we don't end up with multiple instances running when you refresh the skin.

So for instance, from the command line, Notepad can be started with:

C:\Windows\System32\Notepad.exe "Path\FileToLoad.txt"

or WinAmp with:

"C:\Program Files (x86)\Winamp\winamp.exe" "Path\SongToPlay.mp3"
"C:\Program Files (x86)\Winamp\winamp.exe" "Path\Playlist.m3u"

As long as you can pass an existing playlist to WMP as a command line parameter, it should work. I have no idea if that is true or what the parameter should look like for WMP however.

Perhaps this will help: http://msdn.microsoft.com/en-us/library/windows/desktop/dd562624(v=vs.85).aspx
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: StartMe

Post by fonpaolo »

Thanks!! :thumbup: :D

I have to study but I'm almost sure it can be done.

I have to think If I can use it in my skin, since the player skin is designed for many players and obviously they use different commands, I'm trying to make it the most "user friendly" I can...
and saying: "in order to use it with your player you have to find the right value and change it manually..." isn't an option. :sly:

I use NowPlaying to obtain measures and send commands to the player.
I'll see what I can do.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: StartMe

Post by fonpaolo »

I forgot one more question:
Is it possible to use a #variable# instead of the player path, so I can add a line in my Config.inc and set the path directly from my Options skin?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: StartMe

Post by jsmorley »

fonpaolo wrote:I forgot one more question:
Is it possible to use a #variable# instead of the player path, so I can add a line in my Config.inc and set the path directly from my Options skin?

Sure...

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=["#@#Addons\StartMe.exe" "#PlayerPath#" "" "Minimize"]
OnCloseAction=["#@#Addons\StartMe.exe" "#PlayerPath#" "Close"]

[Metadata]
Name=StartMe
Author=JSMorley
Information=Demonstration of little addon to start an application with parameter and Minimized/Maximized state. || See StartMe.ini for further instructions.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Oct 2, 2013

[Variables]
PlayerName=Winamp
PlayerPath="C:\Program Files (x86)\Winamp\winamp.exe"

[MeasureRunning]
Measure=Plugin
Plugin=Process
ProcessName=#PlayerName#.exe
IfAboveValue=0
IfAboveAction=[!SetOption MeterRunning FontColor 153,217,137,255][!SetOption MeterRunning Text "#PlayerName# is running"][!UpdateMeter *][!Redraw]
IfBelowValue=0
IfBelowAction=[!SetOption MeterRunning FontColor 173,173,173,255][!SetOption MeterRunning Text "#PlayerName# is not running"][!UpdateMeter *][!Redraw]

[MeterRunning]
Meter=String
FontSize=14
FontColor=173,173,173,255
AntiAlias=1
SolidColor=47,47,47,255
Padding=5,5,5,5
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: StartMe

Post by fonpaolo »

Thanks, I was almost sure... but better to ask.

As a side note, I have tested the command lines but without the maximize/minimize operation, it won't play.

Tested the "short" path (only the player name "wmplayer.exe) and as I was thinking the program starts.

Tested also the "short" path for the playlist (only the playlist name) and it's loaded, but no way to play without the operation above.

Maybe other players don't have this kind of problems, but I must think if this little "bug" of WMP can be a problem for developing my skin. :???:
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: StartMe

Post by fonpaolo »

Other news... another proof that I'm lucky :sly:

Tested with VLC player, (CAD interface) I use it for some videos since it can read many formats.

Even if there's the "minimize" command, it starts in his normal size... I know it's not the best, as music player, or at least, for me.

In this case, I have to add the full path.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: StartMe

Post by jsmorley »

fonpaolo wrote:Other news... another proof that I'm lucky :sly:

Tested with VLC player, (CAD interface) I use it for some videos since it can read many formats.

Even if there's the "minimize" command, it starts in his normal size... I know it's not the best, as music player, or at least, for me.

In this case, I have to add the full path.
With VLC, you can add the phrase

--qt-start-minimized

alone or with any other parameters you pass it, and it will start minimized to the system tray.

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=["#@#Addons\StartMe.exe" "#PlayerPath#" "--qt-start-minimized" "Minimize"]
OnCloseAction=["#@#Addons\StartMe.exe" "#PlayerPath#" "Close"]

[Metadata]
Name=StartMe
Author=JSMorley
Information=Demonstration of little addon to start an application with parameter and Minimized/Maximized state. || See StartMe.ini for further instructions.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Oct 2, 2013

[Variables]
PlayerName=VLC
PlayerPath="C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"
I know that none of this helps with making something that is "generic".
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: StartMe

Post by fonpaolo »

Thanks, but as you said, it's not that easy to build something that could be used with many players and make the skin as easy to use for everyone, maybe knowing little or nothing of coding...

If the skin was only for me, as I always do, it's not a problem add or modify something when not working at all or as I wish.
Maybe I'm trying to make the skins too easy to configure and to obtain this I'm fighting with a lot of problems, maybe I'm lazy and I only want a place where to set properly all the skins at once...

For the moment, I think I leave the skin without your addon, but only for the distributable version. :D

...in the meantime, I'll try to find a solution.