Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
bubblyboo
8 discussion posts
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"

Code

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.
• Attachment [protected]: 0MZXbIX[1].png [84,666 bytes]
• Attachment [protected]: V2YwRZO[1].png [268,003 bytes]
Jan 23, 2017 (modified Jan 23, 2017)  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
For the BFS.Window.MoveToMonitorMaximized(1, windowHandle); line, you can use 101 for the top split, and 102 for the bottom split :)

Regarding the restore of the window positions, you can indeed use the "Desktop Unlocked" Trigger. It will only fire once when the desktop is unlocked :)
Jan 23, 2017  • #2
User Image
bubblyboo
8 discussion posts
Sorry for the late reply. Thanks a ton!

Actually an additional question. With the triggers, if I set it to "desktop locked" for save windows positions, will that actually work since the trigger activates after the desktop get locked?
Jan 30, 2017 (modified Jan 30, 2017)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
It should, yep! That's how I have mine setup and it works great :)
Jan 31, 2017  • #4
User Image
bubblyboo
8 discussion posts
Everything seems to be working as it should right now. Thanks again Keith!
Jan 31, 2017  • #5
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)