Refresh Rainmeter for resolution change
Posted: February 24th, 2010, 5:02 am
I use a tablet, and was constantly frustrated by the lack of the ability for rainmeter to detect when resolution was changed (in my case, going to portrait mode). This often resulted in the malformation of my desktop config.
Anyway, I solved this issue today, by rewriting my config settings using dynamic locations (relative to desktop edges), and writing a small autoit script to detect when the desktop resolution changes and passing a refresh bang to rainmeter.
Below is the source, attached is the compiled version (scan with whatever you want. I think autoit sometimes comes up with false positives, *shrug*, that is while I supply the source). I found a 1s sleep period to be optimal for responsiveness while not destroying cpu cycles, but YMMV.
Hope someone else finds this useful.
Anyway, I solved this issue today, by rewriting my config settings using dynamic locations (relative to desktop edges), and writing a small autoit script to detect when the desktop resolution changes and passing a refresh bang to rainmeter.
Below is the source, attached is the compiled version (scan with whatever you want. I think autoit sometimes comes up with false positives, *shrug*, that is while I supply the source). I found a 1s sleep period to be optimal for responsiveness while not destroying cpu cycles, but YMMV.
Hope someone else finds this useful.
Code: Select all
#NoTrayIcon
$state = @DesktopHeight
$cmd = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Rainmeter", "") & "\Rainmeter.exe !RainmeterRefresh"
Do
If @DesktopHeight < $state OR @DesktopHeight > $state Then
$state = @DesktopHeight
RunWait ($cmd)
EndIf
Sleep(1000)
Until $state > 9000