It is currently April 19th, 2024, 2:49 am
Function for sensing taskbar state when in autohide
-
- Posts: 23
- Joined: October 8th, 2018, 4:38 pm
Function for sensing taskbar state when in autohide
Is there any known way for Rainmeter to sense the current state the taskbar is in when the autohide option is turned on (shown/ hidden)? I'm asking because I'm wondering if there is a way for a Rainmeter skin to react to that. Or would that need a specialized plugin that probably doesn't exist atm?
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: Function for sensing taskbar state when in autohide
Yes this is possible by reading a specific value from the registry.Slim08 wrote: ↑November 4th, 2018, 11:16 pm Is there any known way for Rainmeter to sense the current state the taskbar is in when the autohide option is turned on (shown/ hidden)? I'm asking because I'm wondering if there is a way for a Rainmeter skin to react to that. Or would that need a specialized plugin that probably doesn't exist atm?
I'm not on my computer though so I will post a way tomorrow if nobody does before me.
Have a look here:
https://forum.rainmeter.net/viewtopic.php?f=5&t=29574&p=153240&hilit=Registry#p153240
But instead of the "03" I wanted to check in this thread, you want to check the number after the ....ff,ff,ff which in the thread is 02. This means Auto hide is not activated, if it said 03 after the ff,ff,ff then it would mean that it's activated.
-
- Posts: 23
- Joined: October 8th, 2018, 4:38 pm
Re: Function for sensing taskbar state when in autohide
I toyed a bit around with your suggested code from https://forum.rainmeter.net/viewtopic.php?f=5&t=29574&p=153240&hilit=Registry#p153240 and I believe that we both think of something different when talking about a function for sensing taskbar state when in autohide. What I meant was a way to get a value in real time that represents whether or not the taskbar is hidden in that very moment. I believe what your code does is basically telling me if the setting "autohide" is turned on or not but not the actual real time state the taskbar is in at that moment.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Function for sensing taskbar state when in autohide
I don't believe this is possible. The only real indication readily available to Rainmeter is the desktop work area, but although that will be the size of the screen less the taskbar when the taskbar is set to always show, it will be the size of the entire screen when the taskbar is set to auto-hide, and won't change based on whether the taskbar is showing at any given moment or not.
There may be something clever I havn't thought of, but I don't see a way right off.
There may be something clever I havn't thought of, but I don't see a way right off.
-
- Posts: 23
- Joined: October 8th, 2018, 4:38 pm
Re: Function for sensing taskbar state when in autohide
Does any of those functions #WORKAREA# #SCREENAREA# #VSCREENAREA# work in a way that they get affected by a taskbar that is in autohide mode?jsmorley wrote: ↑November 5th, 2018, 6:04 pm I don't believe this is possible. The only real indication readily available to Rainmeter is the desktop work area, but although that will be the size of the screen less the taskbar when the taskbar is set to always show, it will be the size of the entire screen when the taskbar is set to auto-hide, and won't change based on whether the taskbar is showing at any given moment or not.
There may be something clever I havn't thought of, but I don't see a way right off.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Function for sensing taskbar state when in autohide
No, they don't.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Function for sensing taskbar state when in autohide
It's how Windows deals with it. When the taskbar is always showing, the work area is set to the screen less the taskbar, so applications maximize without trying to cover it up or getting behind it. When the taskbar is set to auto-hide, the assumption is that you want applications to maximize to the entire screen, and when the taskbar is shown, it is just on top of the application(s). So the work area is set smaller when the taskbar is always showing, and set to the entire screen when the taskbar is auto-hide. Makes no difference in that case if it is actually up or down at any given moment.
-
- Posts: 23
- Joined: October 8th, 2018, 4:38 pm
Re: Function for sensing taskbar state when in autohide
Anyway, thanks for taking the time guys. I appreciate it.
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Function for sensing taskbar state when in autohide
Despite what jsmorley wrote, maybe there could be one way: you have to calculate the difference between the #SCREENAREAHEIGHT# and #WORKAREAHEIGHT# variables (at least if the taskbar is positioned to bottom / top of screen). If this difference is 0 the taskbar is set to autohide, otherwise it is set to be always visible:
Code: Select all
[Rainmeter]
Update=1000
[MeasureDifference]
Measure=Calc
Formula=( #SCREENAREAHEIGHT# - #WORKAREAHEIGHT# )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterDifference Text "Taskbar set to Autohide"][!UpdateMeter "MeterDifference"][!Redraw]
IfFalseAction=[!SetOption MeterDifference Text "Taskbar not set to Autohide"][!UpdateMeter "MeterDifference"][!Redraw]
DynamicVariables=1
[MeterDifference]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Function for sensing taskbar state when in autohide
Yes, but knowing it is set to auto-hide is not his issue. He can get that from the registry. The issue that he is trying to solve is "is it UP or DOWN at this moment, and those variables won't help with that.balala wrote: ↑November 5th, 2018, 7:29 pm Despite what jsmorley wrote, maybe there could be one way: you have to calculate the difference between the #SCREENAREAHEIGHT# and #WORKAREAHEIGHT# variables (at least if the taskbar is positioned to bottom / top of screen). If this difference is 0 the taskbar is set to autohide, otherwise it is set to be always visible:What the skin / the [MeterDifference] meter shows is this setting of taskbar.Code: Select all
[Rainmeter] Update=1000 [MeasureDifference] Measure=Calc Formula=( #SCREENAREAHEIGHT# - #WORKAREAHEIGHT# ) IfCondition=(#CURRENTSECTION#=0) IfTrueAction=[!SetOption MeterDifference Text "Taskbar set to Autohide"][!UpdateMeter "MeterDifference"][!Redraw] IfFalseAction=[!SetOption MeterDifference Text "Taskbar not set to Autohide"][!UpdateMeter "MeterDifference"][!Redraw] DynamicVariables=1 [MeterDifference] Meter=STRING X=0 Y=0 Padding=15,5,15,5 FontColor=220,220,220 SolidColor=0,0,0,150 FontSize=8 FontFace=Segoe UI StringStyle=BOLD StringAlign=LEFT AntiAlias=1