Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Metadata]
Name=WindowState
Author=JSMorley
Version=Sep 15, 2015
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=Demonstrates the included WindowState.exe AutoIt addon to check the "state" of any program window.
; Notes: The variable TitleRegExp must be part or all of the "Title" string displayed in the title bar of the window you wish to check. This does not operate on the "process" name, but the "window" name of the application. This is a case-insensitive regular expression.
; While simply searching for "Notepad" to find the window for Notepad.exe will work, it can be ambiguous if you also have Notepad++ running, or even a browser opened to a site with "notepad" anywhere in the site title. Using ".* - Notepad$" in this instance is going to more reliably find the Notepad.exe window.
; The WindowState.exe addon is simply called with:
; WindowState.exe "Title string to search for"
; It will return to STDOUT a decimal number that is the addition of the following matching attributes:
;1 = Window exists
;2 = Window is visible
;4 = Window is enabled
;8 = Window has focus
;16 = Window is minimized
;32 = Window is maximized
;The Bitwise AND (&) operator is used to determine if any specific hex attribute is set:
;0x1 = Window exists
;0x2 = Window is visible
;0x4 = Window is enabled
;0x8 = Window has focus
;0x10 = Window is minimized
;0x20 = Window is maximized
[Variables]
TitleRegExp=.* - Notepad$
CosmeticName=Notepad
Exists=0x1
Visible=0x2
Enabled=0x4
Focus=0x8
Minimized=0x10
Maximized=0x20
[MeasureUpdate]
Measure=Calc
Formula=1
UpdateDivider=5
OnUpdateAction=[!CommandMeasure MeasureWindow "Run"]
[MeasureWindow]
Measure=Plugin
Plugin=RunCommand
Program="#@#Addons\WindowState.exe"
Parameter=""#TitleRegExp#""
OutputType=ANSI
FinishAction=[!EnableMeasureGroup States][!ShowMeter MeterWindowState]
[MeasureExists]
Measure=Calc
Group=States
Formula=[MeasureWindow] & #Exists# = #Exists# ? 1 : -1
Disabled=1
DynamicVariables=1
Substitute="-1":"☐","1":"☑"
[MeasureVisible]
Measure=Calc
Group=States
Formula=[MeasureWindow] & #Visible# = #Visible# ? 1 : -1
Disabled=1
DynamicVariables=1
Substitute="-1":"☐","1":"☑"
[MeasureEnabled]
Measure=Calc
Group=States
Formula=[MeasureWindow] & #Enabled# = #Enabled# ? 1 : -1
Disabled=1
DynamicVariables=1
Substitute="-1":"☐","1":"☑"
[MeasureFocus]
Measure=Calc
Group=States
Formula=[MeasureWindow] & #Focus# = #Focus# ? 1 : -1
Disabled=1
DynamicVariables=1
Substitute="-1":"☐","1":"☑"
[MeasureMinimized]
Measure=Calc
Group=States
Formula=[MeasureWindow] & #Minimized# = #Minimized# ? 1 : -1
Disabled=1
DynamicVariables=1
Substitute="-1":"☐","1":"☑"
[MeasureMaximized]
Measure=Calc
Group=States
Formula=[MeasureWindow] & #Maximized# = #Maximized# ? 1 : -1
Disabled=1
DynamicVariables=1
Substitute="-1":"☐","1":"☑"
[MeterWindowState]
Meter=String
FontSize=15
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=#CosmeticName##CRLF#Exists [MeasureExists]#CRLF#Visible [MeasureVisible]#CRLF#Enabled [MeasureEnabled]#CRLF#Focus [MeasureFocus]#CRLF#Minimized [MeasureMinimized]#CRLF#Maximized [MeasureMaximized]#CRLF#
InlineSetting=Size | 20
InlinePattern=#CosmeticName#
InlineSetting2=GradientColor | 180 | 252,94,37 ; 0.0 | 252,117,41 ; 0.25 | 251,163,48 ; 0.5 | 249,215,56 ; 0.75 | 249,242,61 ; 1.0
InlinePattern2=#CosmeticName#
InlineSetting3=Color | 209,209,209
InlinePattern3=#CRLF#.*☐
InlineSetting4=Color | 182,252,196
InlinePattern4=#CRLF#.*☑
Hidden=1
DynamicVariables=1
Windows 10 in particular has a different way of looking at resources and performance. As far as it is concerned "unused memory" is just wasted memory. It considers "performance" to be far more important than "free memory", and will use just tons of extra memory "parking" stuff, particularly "modern apps", that you used and just might use again at some point. If you were to ever get to the point where you actually needed more physical memory than is "free", it will then happily trash enough of the "parked" stuff to make room for you. This is actually a really good approach, but takes some getting used to. If you are worried about "free memory", then Windows 10 is going to make you nervous indeed. However, you are wrong to do so. Free memory is pointless.
Also be aware that applications that are running "minimized to the notification area" (the system tray) will often have a "window" detected as "exists" and "enabled", but none of the others. They will not be seen as "minimized" when in the notification area.