I didnt want to use PerfMon because WindowState seems to use less CPU load.
I know the modified code i made is pretty inefficient cuz I suck at it, but I just want it to work . (original skin/code: https://forum.rainmeter.net/viewtopic.php?t=21785)
It does work when I test it but after sometime, say half an hour (?), it will freeze and not update.
And the log would say a bunch of:
Code: Select all
Error 101: Program still running: C:\Users\Neko\Documents\Rainmeter\Skins\hiuwoWindowState2@Resources\Addons\WindowState.exe (hiuwoWindowState2\WindowStateEACH.ini - [MeasureWindow6])
.
.
.
Error 101: Program still running: C:\Users\Neko\Documents\Rainmeter\Skins\hiuwoWindowState2@Resources\Addons\WindowState.exe (hiuwoWindowState2\WindowStateEACH.ini - [MeasureWindow6])
Can someone help me identify why and perhaps make it a bit more efficient? Super thankful!!
Here is the code https://pastebin.com/dkFa8U4U (very sorry for the crazy inefficient codes):
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
;https://forum.rainmeter.net/viewtopic.php?t=21785
;https://docs.rainmeter.net/tips/update-guide/
[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]
TitleRegExp1=Outplayed.*$
TitleRegExp2=Blitz.*$
TitleRegExp3=League of Legends.*$
TitleRegExp4=θ±ιθ―ηε°ε©ζ.*$
TitleRegExp5=Discord.*$
TitleRegExp6=Google Chrome.*$
CosmeticName=All
Exists=0x1
;Visible=0x2
;Enabled=0x4
;Focus=0x8
;Minimized=0x10
;Maximized=0x20
[MeasureUpdate]
Measure=Calc
Formula=1
UpdateDivider=5 ;5
OnUpdateAction=[!CommandMeasure MeasureWindow1 "Run"] [!CommandMeasure MeasureWindow2 "Run"] [!CommandMeasure MeasureWindow3 "Run"] [!CommandMeasure MeasureWindow4 "Run"] [!CommandMeasure MeasureWindow5 "Run"] [!CommandMeasure MeasureWindow6 "Run"]
[MeasureWindow1]
Measure=Plugin
Plugin=RunCommand
Program="#@#Addons\WindowState.exe"
Parameter=""#TitleRegExp1#""
OutputType=ANSI
;FinishAction=[!EnableMeasureGroup States][!ShowMeter MeterWindowState]
[MeasureExists1]
Measure=Calc
Group=States
Formula=[MeasureWindow1] & #Exists# = #Exists# ? 1 : -1
;Disabled=1
DynamicVariables=1
Substitute="-1":"β","1":"β"
[MeasureWindow2]
Measure=Plugin
Plugin=RunCommand
Program="#@#Addons\WindowState.exe"
Parameter=""#TitleRegExp2#""
OutputType=ANSI
;FinishAction=[!EnableMeasureGroup States][!ShowMeter MeterWindowState]
[MeasureExists2]
Measure=Calc
Group=States
Formula=[MeasureWindow2] & #Exists# = #Exists# ? 1 : -1
;Disabled=1
DynamicVariables=1
Substitute="-1":"β","1":"β"
[MeasureWindow3]
Measure=Plugin
Plugin=RunCommand
Program="#@#Addons\WindowState.exe"
Parameter=""#TitleRegExp3#""
OutputType=ANSI
;FinishAction=[!EnableMeasureGroup States][!ShowMeter MeterWindowState]
[MeasureExists3]
Measure=Calc
Group=States
Formula=[MeasureWindow3] & #Exists# = #Exists# ? 1 : -1
;Disabled=1
DynamicVariables=1
Substitute="-1":"β","1":"β"
[MeasureWindow4]
Measure=Plugin
Plugin=RunCommand
Program="#@#Addons\WindowState.exe"
Parameter=""#TitleRegExp4#""
OutputType=ANSI
;FinishAction=[!EnableMeasureGroup States][!ShowMeter MeterWindowState]
[MeasureExists4]
Measure=Calc
Group=States
Formula=[MeasureWindow4] & #Exists# = #Exists# ? 1 : -1
;Disabled=1
DynamicVariables=1
Substitute="-1":"β","1":"β"
[MeasureWindow5]
Measure=Plugin
Plugin=RunCommand
Program="#@#Addons\WindowState.exe"
Parameter=""#TitleRegExp5#""
OutputType=ANSI
;FinishAction=[!EnableMeasureGroup States]
;[!ShowMeter MeterWindowState MeterWindowState2 MeterWindowState3 MeterWindowState4 MeterWindowState5]
[MeasureExists5]
Measure=Calc
Group=States
Formula=[MeasureWindow5] & #Exists# = #Exists# ? 1 : -1
;Disabled=1
DynamicVariables=1
Substitute="-1":"β","1":"β"
[MeasureWindow6]
Measure=Plugin
Plugin=RunCommand
Program="#@#Addons\WindowState.exe"
Parameter=""#TitleRegExp6#""
OutputType=ANSI
;FinishAction=[!EnableMeasureGroup States]
;[!ShowMeter MeterWindowState MeterWindowState2 MeterWindowState3 MeterWindowState4 MeterWindowState5]
[MeasureExists6]
Measure=Calc
Group=States
Formula=[MeasureWindow6] & #Exists# = #Exists# ? 1 : -1
;Disabled=1
DynamicVariables=1
Substitute="-1":"β","1":"β"
[textStyleGen]
FontSize=15
FontColor=255,255,255,255
Padding=5,5,5,5
AntiAlias=0
[titletext]
Meter=String
MeterStyle=textStyleGen
SolidColor=47,47,47,200
FontSize=16
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#
Text=#CosmeticName# .#CRLF##CRLF##CRLF##CRLF##CRLF##CRLF##CRLF#
LeftMouseUpAction=["C:\Windows\System32\cmd.exe" /c "D:\Tools\bats\LoL triplet.bat"]
[MeterWindowState]
Meter=String
MeterStyle=textStyleGen
Y=30 ;25+5
;FontSize=15
;FontColor=255,255,255,255
;SolidColor=47,47,47,200
;Padding=5,5,5,5
;AntiAlias=0
Text=Outplayed [MeasureExists1]#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#
InlineSetting=Color | 209,209,209
InlinePattern=.*β#CRLF#
InlineSetting2=Color | 182,252,196
InlinePattern2=.*β#CRLF#
;Hidden=1
DynamicVariables=1
LeftMouseUpAction=["C:\Program Files (x86)\Overwolf\OverwolfLauncher.exe" -launchapp cghphpbjeabdkomiphingnegihoigeggcfphdofo -from-desktop]
[MeterWindowState2]
Meter=String
MeterStyle=textStyleGen
Y=55 ;50
Text=Blitz [MeasureExists2]#CRLF#
InlineSetting=Color | 209,209,209
InlinePattern=.*β#CRLF#
InlineSetting2=Color | 182,252,196
InlinePattern2=.*β#CRLF#
;Hidden=1
DynamicVariables=1
LeftMouseUpAction=["C:\WINDOWS\system32\schtasks.exe" /run /tn "Blitz.exe_546938825"]
[MeterWindowState3]
Meter=String
MeterStyle=textStyleGen
Y=80 ;75
Text=LeagueClient [MeasureExists3]#CRLF#
InlineSetting=Color | 209,209,209
InlinePattern=.*β#CRLF#
InlineSetting2=Color | 182,252,196
InlinePattern2=.*β#CRLF#
;Hidden=1
DynamicVariables=1
LeftMouseUpAction=["C:\Games\Main Games\Riot Games\Riot Client\RiotClientServices.exe"]
[MeterWindowState4]
Meter=String
MeterStyle=textStyleGen
Y=105 ;100+5
Text=LeaguHelper [MeasureExists4]#CRLF#
InlineSetting=Color | 209,209,209
InlinePattern=.*β#CRLF#
InlineSetting2=Color | 182,252,196
InlinePattern2=.*β#CRLF#
;Hidden=1
DynamicVariables=1
LeftMouseUpAction=["C:\Users\Neko\Downloads\LeaguHelper v1.3.1.exe"]
[MeterWindowState5]
Meter=String
MeterStyle=textStyleGen
Y=130 ;125+5
Text=Discord [MeasureExists5]#CRLF#
InlineSetting=Color | 209,209,209
InlinePattern=.*β#CRLF#
InlineSetting2=Color | 182,252,196
InlinePattern2=.*β#CRLF#
;Hidden=1
DynamicVariables=1
LeftMouseUpAction=["C:\Users\Neko\AppData\Local\Discord\Update.exe" --processStart Discord.exe]
[MeterWindowState6]
Meter=String
MeterStyle=textStyleGen
Y=155 ;150+5
Text=Chrome [MeasureExists6]#CRLF#
InlineSetting=Color | 209,209,209
InlinePattern=.*β#CRLF#
InlineSetting2=Color | 182,252,196
InlinePattern2=.*β#CRLF#
;Hidden=1
DynamicVariables=1