It is currently September 22nd, 2021, 9:22 am

IsFullScreen 3.0

Plugins and Addons popular with the Community
User avatar
Cariboudjan
Posts: 193
Joined: May 12th, 2019, 8:55 am

Re: IsFullScreen 3.0

Post by Cariboudjan »

Cherryleaf wrote: February 27th, 2020, 5:54 am This code would do it, but I'm not sure if I feel like implementing it.

Code: Select all

bool isFullscreen(HWND windowHandle)
{
    MONITORINFO monitorInfo = { 0 };
    monitorInfo.cbSize = sizeof(MONITORINFO);
    GetMonitorInfo(MonitorFromWindow(windowHandle, MONITOR_DEFAULTTOPRIMARY), &monitorInfo);

    RECT windowRect;
    GetWindowRect(windowHandle, &windowRect);

    return windowRect.left == monitorInfo.rcMonitor.left
        && windowRect.right == monitorInfo.rcMonitor.right
        && windowRect.top == monitorInfo.rcMonitor.top
        && windowRect.bottom == monitorInfo.rcMonitor.bottom;
}
:oops: Pleeeease?

Code: Select all

Chrome.exe
Maximized and has focus on Monitor 2

Explorer.EXE
Windowed and has focus on Monitor 1

mspaint.exe
Fullscreen has has focus on Monitor 0
User avatar
Cariboudjan
Posts: 193
Joined: May 12th, 2019, 8:55 am

Re: IsFullScreen 3.0

Post by Cariboudjan »

...sigh.

SIGH...

SIGH...

I guess I'll need to use IsFullScreen plugin with an update of 10 milliseconds to replace the recent 4.4 focus fix.
Gouloudrouioul
Posts: 17
Joined: May 17th, 2020, 2:07 am

Re: IsFullScreen 3.0

Post by Gouloudrouioul »

Hello I have a question about this really helpful plugin !

So... I just downloaded it and used the default skin that displays the application that currently has focus, and if it is full screen or not.

But It always display "Not full screen", even if I am in full screen.

Why ? :?
User avatar
jsmorley
Developer
Posts: 22291
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IsFullScreen 3.0

Post by jsmorley »

Gouloudrouioul wrote: May 23rd, 2020, 3:37 pm Hello I have a question about this really helpful plugin !

So... I just downloaded it and used the default skin that displays the application that currently has focus, and if it is full screen or not.

But It always display "Not full screen", even if I am in full screen.

Why ? :?
Hard to say. The rules are that the application has "focus" and that it is actually "full screen", not just a maximized window, that is NOT "full screen".

Give your browser focus by clicking on it, then hit F11 to make it true full screen. The skin should indicate such.
Gouloudrouioul
Posts: 17
Joined: May 17th, 2020, 2:07 am

Re: IsFullScreen 3.0

Post by Gouloudrouioul »

Ho hey indeed you're right... :D
Damn, I was looking for something similar to IsFullScreen but with maximized windows... Is there such a plugin ?
User avatar
jsmorley
Developer
Posts: 22291
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IsFullScreen 3.0

Post by jsmorley »

Gouloudrouioul wrote: May 23rd, 2020, 3:57 pm Ho hey indeed you're right... :D
Damn, I was looking for something similar to IsFullScreen but with maximized windows... Is there such a plugin ?
There is no plugin I am aware of, but there is a little addon executable I wrote a while back that might help some.

https://forum.rainmeter.net/viewtopic.php?f=128&t=21785&hilit=windowstate#p115480
User avatar
Cariboudjan
Posts: 193
Joined: May 12th, 2019, 8:55 am

Re: IsFullScreen 3.0

Post by Cariboudjan »

Here is another technique for getting by the desktop focus = fullscreen problem:

Code: Select all

[MeasureIsFullScreen]
Measure=Plugin
Plugin=IsFullScreen
OnChangeAction=[!UpdateMeasure MeasureCheckProcess]

[MeasureCheckProcess]
Measure=String
String=[MeasureIsFullScreen:][MeasureIsFullScreen]
IfMatch=(?is)1Explorer.exe|0.*
IfMatchAction=STUFF THAT HAPPENS WHEN NO WINDOW IS FULLSCREEN
IfNotMatchAction=STUFF THAT HAPPENS WHEN SOMETHING IS FULLSCREEN
UpdateDivider=-1
DynamicVariables=1
Pretty simple. No need to use a !SetVariable bang... Checked and works.

Basically any time Explorer.exe is the focus and [MeasureIsFullScreen] = 1, it forces it to perform the [MeasureIsFullScreen] = 0 action anyway. You can add any number of additional apps to this filter by just changing IfMatch to (?is)1Explorer.exe|(?is)1YOURAPPNAME.exe|0.*
User avatar
Cariboudjan
Posts: 193
Joined: May 12th, 2019, 8:55 am

Re: IsFullScreen 3.0

Post by Cariboudjan »

jsmorley wrote: April 18th, 2018, 3:25 amNote that the parent process for all Windows 10 "apps", including things like Settings or Windows Update, as well as apps like OneNote or Calculator, is a process called ApplicationFrameHost.exe. That will always be returned in those cases. No, it can't tell you that you are playing Microsoft Solitaire.
Any chance this could be fixed? I found this for getting the actual name of a UWP application (C#)
https://stackoverflow.com/questions/39702704/connecting-uwp-apps-hosted-by-applicationframehost-to-their-real-processes

Code: Select all

class FindHostedProcess
{
    public Timer MyTimer { get; set; }
    private Process _realProcess;
    public FindHostedProcess()
    {
        MyTimer = new Timer(TimerCallback, null, 0, 1000);
        Console.ReadKey();
    }

    private void TimerCallback(object state)
    {
        var foregroundProcess = Process.GetProcessById(WinAPIFunctions.GetWindowProcessId(WinAPIFunctions.GetforegroundWindow()));
        if (foregroundProcess.ProcessName == "ApplicationFrameHost")
        {
            foregroundProcess = GetRealProcess(foregroundProcess);
        }
        Console.WriteLine(foregroundProcess.ProcessName);
    }

    private Process GetRealProcess(Process foregroundProcess)
    {
        WinAPIFunctions.EnumChildWindows(foregroundProcess.MainWindowHandle, ChildWindowCallback, IntPtr.Zero);
        return _realProcess;
    }

    private bool ChildWindowCallback(IntPtr hwnd, IntPtr lparam)
    {
        var process = Process.GetProcessById(WinAPIFunctions.GetWindowProcessId(hwnd));
        if (process.ProcessName != "ApplicationFrameHost")
        {
            _realProcess = process;
        }
        return true;
    }
}