It is currently September 20th, 2019, 8:24 am

Check whether skin is hidden or not...

Help with creating, editing & fixing problems with skins
User avatar
JosephB2000
Posts: 155
Joined: July 29th, 2014, 7:02 pm

Check whether skin is hidden or not...

JosephB2000 » August 8th, 2019, 11:29 am

Currently I need to check whether a different skin is hidden or not... I believe that skins are hidden by setting their window width to 0, however, I am unsure of how to check the width of a skin.

Any help would be appreciated! :)
[Insert Joke Here]
User avatar
jsmorley
Developer
Posts: 19461
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Check whether skin is hidden or not...

jsmorley » August 8th, 2019, 12:05 pm

No, the skin window is hidden by setting Window's WS_VISIBLE "state" of the window to "hidden". The width and height are not altered.

You can check it with the ConfigActive plugin I wrote a while back...

https://forum.rainmeter.net/viewtopic.php?f=127&t=28720&hilit=skin+hidden#p149824
https://forum.rainmeter.net/viewtopic.php?f=127&t=28720&hilit=skin+hidden&start=20#p160921

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
ConfigToCheck=illustro\Clock

[MeasureActive]
Measure=Plugin
Plugin=ConfigActive
ConfigName=#ConfigToCheck#
DynamicVariables=1
IfCondition=[&MeasureActive:IsHidden(#ConfigToCheck#)] = 1
IfTrueAction=[!SetOption MeterIsHidden Text "#ConfigToCheck# is hidden"]
IfFalseAction=[!SetOption MeterIsHidden Text "#ConfigToCheck# is visible"]

[MeterIsHidden]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Note that this is based on the skin's config name, not the skin's .ini variant name.

Also note that this is based on the hidden state of the skin window, and has nothing to do with size or opacity. The hidden state of a window is its own thing. A window that has a width and height of zero is not hidden. A window that has an opacity of zero is not hidden.

In order to be fully robust with this, I'd be tempted to first test that the config in question is "active" and only if that is true, then check the hidden state and take whatever action based on that. A config that is not loaded is also not "hidden"...
User avatar
jsmorley
Developer
Posts: 19461
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Check whether skin is hidden or not...

jsmorley » August 8th, 2019, 1:09 pm

So perhaps something like:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
ConfigToCheck=illustro\Clock

[MeasureActive]
Measure=Plugin
Plugin=ConfigActive
ConfigName=#ConfigToCheck#
DynamicVariables=1
IfCondition=[&MeasureActive:IsHidden(#ConfigToCheck#)] = 0
IfTrueAction=[!SetOption MeterIsHidden Text "#ConfigToCheck# is not loaded"]
IfCondition2=[&MeasureActive:IsHidden(#ConfigToCheck#)] = -1
IfTrueAction2=[!SetOption MeterIsHidden Text "#ConfigToCheck# is visible"]
IfCondition3=[&MeasureActive:IsHidden(#ConfigToCheck#)] = 1
IfTrueAction3=[!SetOption MeterIsHidden Text "#ConfigToCheck# is hidden"]

[MeterIsHidden]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1