If you don't want to install AutoHotKey, you can use this:
StealFocus.zip
Skin:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnFocusAction=[!SetOption MeterFocusMe Text "I have Gained Focus"][!UpdateMeter *][!Redraw]
OnUnfocusAction=[!SetOption MeterFocusMe Text "I have Lost Focus"][!UpdateMeter *][!Redraw]
[MeterFocusMe]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Starting Text
MouseOverAction=["#@#StealFocus.exe" "#CURRENTPATH##CURRENTFILE#"]
StealFocus.ahk:
Code: Select all
for a, b in A_Args {
WinActivate, %b%
}
Keep in mind that OnFocusAction in Rainmeter is about "gaining" focus, not about "having" focus. If you right-click a skin and refresh it, it will already have focus and OnFocusAction will not be fired.
Keep in mind as well that OnFocusAction is about the entire skin "window", and can't be used on any individual meters in a skin.
Lastly, keep in mind that while you can use this StealFocus.exe utility to cause a skin window to "gain" focus with a MouseOverAction, nothing but an actual mouse click somewhere other than the skin will cause the skin to "lose" focus.
If you want to know what window "has" focus, you might use this:
https://forum.rainmeter.net/viewtopic.php?f=128&t=33146#p164704
You do not have the required permissions to view the files attached to this post.