Not sure if we will be adding that to Rainmeter directly, perhaps at some point.
It will never be an action like OnFullScreenAction, we are just not going to have Rainmeter constantly polling for that. However, it is something that might be appropriate for the SysInfo plugin. We will see.
In the meantime, you might try this plugin:
https://forum.rainmeter.net/viewtopic.php?p=147499#p147499
This plugin will check to see if the "foreground" window, the window that
currently has focus, is full screen. The measure will return "1" if so, and "0" if not.
This is only relevant to the primary monitor if you have more than one. It is also only about "full screen", and has no interest in "maximized". That is not the same thing.
Note that if you have a Rainmeter skin set to "Stay topmost" and run some game or program full screen, that is fine unless you click on the Rainmeter skin, as then IT will have "focus" and is not full screen, so the plugin will change to zero. This should not be an issue, since I assume the point is to immediately unload or move to the back any skins that conflict with your game or video or whatever.
As far as I can tell, this should work with any full screen application, desktop program or DirectX game. Certainly seems to work fine with YouTube or other videos running full screen.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Metadata]
Name=IsFullScreen
Author=JSMorley
Version=1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=Demonstrates IsFullScreen Plugin.
; This plugin will check to see if the "foreground" window, the window that currently has
; "focus", is full screen. The measure will return "1" if so, and "0" if not.
[MeasureIsFullScreen]
Measure=Plugin
Plugin=IsFullScreen
UpdateDivider=5
IfCondition=MeasureIsFullScreen=1
IfTrueAction=[!SetOption MeterIsFullScreen Text "A full screen program has focus"][!Log "A full screen program has focus"]
IfFalseAction=[!SetOption MeterIsFullScreen Text "Active window not full screen"][!Log "Active window not full screen"]
[MeterIsFullScreen]
Meter=String
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
You can have the IfCondition do whatever you like, maybe unload some skins, or set the ZPos of some or whatever actions you want to take. About the only thing you probably don't want to use it to do is unload Rainmeter, as then you pull the rug out from under it, and you have no way to know when the full screen program has ended and Rainmeter should be restarted.
Plugin code:
Code: Select all
#include <Windows.h>
#include "../../API/RainmeterAPI.h"
RECT appBounds;
RECT screenBounds;
HWND foregroundHandle;
struct Measure
{
Measure() {}
};
PLUGIN_EXPORT void Initialize(void** data, void* rm)
{
Measure* measure = new Measure;
*data = measure;
}
PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
{
Measure* measure = (Measure*)data;
}
PLUGIN_EXPORT double Update(void* data)
{
Measure* measure = (Measure*)data;
foregroundHandle = GetForegroundWindow();
GetWindowRect(GetDesktopWindow(), &screenBounds);
if (foregroundHandle != GetDesktopWindow() && foregroundHandle != GetShellWindow())
{
GetWindowRect(foregroundHandle, &appBounds);
if (EqualRect(&appBounds, &screenBounds))
{
return 1.0;
}
}
return 0.0;
}
//PLUGIN_EXPORT LPCWSTR GetString(void* data)
//{
// Measure* measure = (Measure*)data;
// return L"";
//}
//PLUGIN_EXPORT void ExecuteBang(void* data, LPCWSTR args)
//{
// Measure* measure = (Measure*)data;
//}
PLUGIN_EXPORT void Finalize(void* data)
{
Measure* measure = (Measure*)data;
delete measure;
}
32 bit and 64bit versions of the plugin for distribution are included in the @Resources folder of the example skin. I probably wouldn't start releasing skins using this to deviantART just yet, I wrote this like 5 minutes ago, and we should make sure it does what is expected with no issues.