It is currently April 28th, 2024, 4:25 am

Open music palyer minimized

Get help with creating, editing & fixing problems with skins
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Open music palyer minimized

Post by mak_kawa »

Hi All.

I am making a skin to control music player (WMP) using Nowplaying plugin. And I encountered a problem. When Nowplaying plugin opens WMP by !CommandMeasure, WMP is always opened with normal window in top position. Because I don't need WMP window, I must click window control button of WMP to minimize it each time. It is not a big problem but a bit bothering for me.

So, I think stupidly that I shall open WMP as minimized before Nowplaying plugin opens and handshakes with it, using a bang as "[cmd /c "start /B /MIN wmplayer.exe"]". But no luck... Nowplaying plugin brings WMP out from task bar as a topmost normal window. I now understand that this behavior is normal as documented in Rainmeter Docs.

How can I open music palyer(WMP) minimized in task bar, when nowplaying plugin opens the player?

Sample Code:

Code: Select all

[Rainmeter]
Update=1000
OnCloseAction=[!CommandMeasure mStatus ClosePlayer]

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=WMP
PlayerType=Title
DisableLeadingZero=1

[mStatus]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=Status
IfCondition=mStatus=0
IfTrueAction=[!CommandMeasure mStatus OpenPlayer]
;IfTrueAction=[cmd /c "start /B /MIN wmplayer.exe"]
;IfTrueAction=[cmd /c "start /B /MIN wmplayer.exe"][!CommandMeasure mStatus OpenPlayer]

[Background]
Meter=Image
W=188
H=96
SolidColor=63,63,63

[PlayPause]
Meter=Image
X=24
Y=24
W=48
H=48
SolidColor=96,96,96
LeftMouseUpAction=[!CommandMeasure mPlayer "PlayPause"]
DynamicVariables=1
ToolTipText="Toggle play/pause"
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open music palyer minimized

Post by balala »

Maybe using the RunCommand plugin? For this add the following measure to your code:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=cmd /c "start /B /MIN wmplayer.exe"
State=Hide
and replace the IfTrueAction option of the [mStatus] measure with the following one: IfTrueAction=[!CommandMeasure "MeasureRun" "Run"].
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Open music palyer minimized

Post by mak_kawa »

Hi Balala.

Thank you for reply. First, my explanation was somewhat not clear, sorry.

Your suggestion is equal to my second code, IfTrueAction=[cmd /c "start /B /MIN wmplayer.exe"]. But it is not enough to make a connection to music player (WMP). In this state, music can not be played by [!CommandMeasure mPlayer "PlayPause"]. [!CommandMeasure mStatus OpenPlayer] is probably necessary to control WMP, but by this command WMP is brought out from task bar as normal window. This is ambivalent.

Just my thought...perhaps WindowMessagePlugin could be used?? But I don't know how describe WindowClass and WindowMessage parameters to minimize WMP window.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Open music palyer minimized

Post by mak_kawa »

Hi balala and all.

I now have sorted out this problem using WindowMessage Plugin.

Here is the part of measure code:

Code: Select all

[SendMessageMinimize]
Measure=Plugin
Plugin=WindowMessagePlugin
WindowName="Windows Media Player"
WindowMessage=274 61472 0
Update=-1

[mStatus]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=Status
IfCondition=mStatus=0
IfTrueAction=[!CommandMeasure mStatus OpenPlayer][!UpdateMeasure SendMessageMinimize]
Anyway, thanks for your kind reply.
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open music palyer minimized

Post by balala »

Glad to help.
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: Open music palyer minimized

Post by CarlotaN »

I know this is a very old topic, but I also try to have the player open minimized.
The mak_kawa system has not worked for me, perhaps because it is from a long time ago.
Balala's version has worked and without using this part:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=cmd /c "start /B /MIN wmplayer.exe"
State=Hide
But if you don't maximize the screen again, you don't have access to the music either. I mean start a song or a list when you press play.
Any solution?

Sorry for my English (from Mr Google)

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

Lo añado en español por si san Google no traduce correctamente. Perdón
Se que este es un tema muy antiguo, pero yo también intento que el reproductor se abra minimizado.
El sistema de mak_kawa no me ha funcionado, quizás porque es de hace tiempo.
La versión de Balala, si que ha funcionado y sin necesidad de usar esta parte:
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=cmd /c "start /B /MIN wmplayer.exe"
State=Hide
Pero si no maximizas de nuevo la pantalla, tampoco tienes acceso a la música. Me refiero a que inicie una canción o una lista al pulsar play.
Image
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open music palyer minimized

Post by balala »

CarlotaN wrote: December 5th, 2022, 6:04 am I know this is a very old topic, but I also try to have the player open minimized.
Let's go ahead one by one. So, we should finish first what has been described in the linked topic, then we'll see...
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: Open music palyer minimized

Post by CarlotaN »

:great: si claro! por supuesto! and thank you very much!!!!
Image