Hello,
This is going to get a bit long, so please just bear with me. I have included what my current setup looks like, as well as the splits that I use. (Primary Monitor #2 : 2560x1440 vertical split down middle. Secondary Monitor #1 1200x1920 horizontal split across middle)
I have already used window location functions/trigger for most of the windows shown in the attachments, so those are fine.
However, with the program (Chrome browser) that I want a different window on each window, I have modified the "Open Chrome on 2 monitors"
using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Update the URLs in the strings below
string website1 = "https://www.google.com";
string website2 = "https://www.displayfusion.com";
// Open website1 on monitor 1
windowHandle = BFS.Web.OpenUrlNewWindow(website1);
BFS.Window.MoveToMonitorMaximized(2, windowHandle);
// Open website2 on monitor 2
windowHandle = BFS.Web.OpenUrlNewWindow(website2);
???????????//BFS.Window.MoveToMonitorMaximized(1, windowHandle);
BFS.Window.MoveToNextMonitor(windowHandle);
BFS.Window.MoveToNextMonitorMaximized(windowHandle);
}
}
So the line that I have marked
?? doesn't work in that I can't seem to get the correct monitorID of the 1200x1920 monitor. Is this due to my custom monitor split or something? I have currently bypassed it through means of the last two lines of code, but I would rather have the monitorID part working for future/other scripts.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So the next part is that I always lock the computer rather than put it to sleep, and the Chrome window on the left always moves around a bit once I come back. I've looked into the Save/Restore Window Positions through the pre-made scripts and most notably saw the "Save Window Positions and Lock Desktop" script which seemed to fit my needs. However, rather than having to use some keybinds after every unlock to restore the Window Positions, is there a way to detect the desktop getting unlocked and automating a restore Window Position? I see that there is the line of "BFS.General.IsDesktopLocked" to check if the desktop is currently locked, but I am unsure how to use it to automate Windows Position Restore (if automation is even possible).
EDIT: Does the Trigger "Desktop unlocked" work just when the desktop gets unlocked or is it continuous as the desktop is unlocked? This might be able to solve my second problem.
Thank you for any help. Displayfusion has saved me from menial and repetitive tasks for a long time now. I can't live without it anymore.