It is currently March 31st, 2020, 9:11 am

Bringing Rainmeter skins into focus

Post reviews, recommendations and questions about other software.
User avatar
Jeff
Posts: 128
Joined: September 3rd, 2018, 11:18 am

Re: Bringing Rainmeter skins into focus

Post by Jeff »

Mor3bane wrote:
January 25th, 2020, 11:55 am
Anyone have this utility still/
Remake it with AutoHotKey, make an AutoHotKey file with

Code: Select all

for a, b in A_Args {
WinActivate, %b%
}
and inside your Rainmeter skin just add MouseOverAction=["#CURRENTPATH#stealfocus.ahk" "#CURRENTPATH##CURRENTFILE#"] anywhere in the skin (any meter or [Rainmeter] section itself) and it will steal focus

This works because the skin's window title is exactly the same as the file path. The only part not covered under warranty by my lack of ahk is when a text editor has the same title as the file name, which I don't think the devs even thought about.
User avatar
jsmorley
Developer
Posts: 20426
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Bringing Rainmeter skins into focus

Post by jsmorley »

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.
User avatar
Mor3bane
Posts: 773
Joined: May 7th, 2016, 7:32 am

Re: Bringing Rainmeter skins into focus

Post by Mor3bane »

Gah!

Nothing is working outside my latest report of losing functionality after loss of focus - I may be doing it wrong so I've attached in case I interpreted thing incorrectly.
Blackout_1.2.rmskin
You do not have the required permissions to view the files attached to this post.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3842
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Bringing Rainmeter skins into focus

Post by eclectic-tech »

Mor3bane wrote:
January 25th, 2020, 3:21 pm
Gah!

Nothing is working outside my latest report of losing functionality after loss of focus - I may be doing it wrong so I've attached in case I interpreted thing incorrectly.
Blackout_1.2.rmskin
I offered a solution for your skin in your other post here...