Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
eadams
2 discussion posts
I am trying to build a hotscript (ctrl-alt-x) that runs a function to move a window to my left monitor. However, I have different monitors when at work and when at home. I created multiple monitor profiles to handle this and want the move coordinates modified depending on which monitor is selected. However the GetCurrentMonitorProfile() function only returns a value if the first monitor function is selected. To verify this is happening in my function I added a "BFS.Dialog.ShowMessageError(BFS.DisplayFusion.GetCurrentMonitorProfile());" to my script to show me which monitor profile is selected. If I pick the first monitor profile, run the function, the dialog box shows the name of the selected first monitor profile. If I pick any other monitor profile then the dialog box is empty. This is causing the if else statement to fail to trigger. I am running Display Fusion 11.2 on Windows 11. I have tried renaming the monitor profiles, but that does not seem to matter. I am not even sure if it is just the first one that works but in my case only that one works.

The monitor profiles I have are
HOME (Center Monitor Center) This one works
HOME (Center Monitor Low) Not work if selected
Laptop + Portable Monitor (Left) Not work if selected
Laptop + Portable Monitor (Right) Not work if selected
WORK3 Not work if selected

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        BFS.Dialog.ShowMessageError(BFS.DisplayFusion.GetCurrentMonitorProfile());
        if (BFS.DisplayFusion.GetCurrentMonitorProfile() == "HOME (Center Monitor Center)")
        {
            BFS.Window.SetSize(windowHandle, 2160, 2100);
            BFS.Window.SetLocation(windowHandle, -2160, 0);
        }
        else if (BFS.DisplayFusion.GetCurrentMonitorProfile() == "WORK 3")
        {
            BFS.Window.SetSize(windowHandle, 1440, 1572);
            BFS.Window.SetLocation(windowHandle, -1440, 1572);
        }    
    }
}


Any ideas what is going on?
Nov 16, 2023 (modified Nov 16, 2023)  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
If you open the Monitor Configuration window when you have one of the other profiles loaded, do they show they are loaded correctly in the "Detected Profile:" box in the top left of that window?
Nov 17, 2023  • #2
User Image
eadams
2 discussion posts
That was the problem. It was not detecting the monitor profile even after loading it. I had to load the profile and then save it. I think I loaded it again and after that it finally starting showing up as detected. For other profiles I will just try to save it again.
Nov 17, 2023  • #3
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)