Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
Manuel Rozier de Linage
17 discussion posts
Hello,
Is there a feature I could use within DisplayFusion that would prevent cascading to open windows were the right border of the newly opened window is no more on my current monitor but appears on my N+1 monitor?

To simulate the problem, on your left monitor open a wide windows explorer window and press CTRL+N multiple times.
After some iterations the close button is no more on your left monitor but on the monitor next to it, I would like the new windows to be "blocked" by the right side of the left monitor.
Sep 10, 2018  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
By blocked, do you mean that once it hits that point, you don't want it to be able to open any more new windows? e.g. You press Ctrl + N, the window is partially on the second screen, so DisplayFusion closes it?

Or do you want DisplayFusion to just move it back inside the work area?
Sep 10, 2018  • #2
User Image
Manuel Rozier de Linage
17 discussion posts
The second proposition is what i would expect : the cascading would continue only vertically
rather than a classical cascading with an vertical ans horizontal offset.
Sep 10, 2018 (modified Sep 10, 2018)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, there isn't currently a feature that could do that, no. If it's something we're able to add in a future version, we'll definitely let you know.

Thanks!
Sep 13, 2018  • #4
User Image
Manuel Rozier de Linage
17 discussion posts
Hello Keith,
I made a Scripted Function for that, I call it when a Windows Explorer window opens.
For info I run Win7 not Win10, don't know if it makes a difference in Epxplorer windows behavior

Code

using System;
using System.Drawing;
using System.Collections.Generic;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {    
        Rectangle rectWin = BFS.Window.GetBounds(windowHandle);
        // Get the current monitor id from the window top left position
        uint monitor = BFS.Monitor.GetMonitorIDByXY(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY());
        Rectangle rectMonitor = BFS.Monitor.GetMonitorWorkAreaByID(monitor);
        if (rectWin.Width < rectMonitor.Width)
        {
            if (rectWin.X + rectWin.Width > rectMonitor.X + rectMonitor.Width) {
                BFS.Window.SetLocation(windowHandle, rectWin.X - ((rectWin.X + rectWin.Width) - (rectMonitor.X + rectMonitor.Width)) , rectWin.Y);
                return; 
            }
        }
    }
}
Sep 2, 2019 (modified Sep 2, 2019)  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Nice! Glad to hear you were able to get that working :)
Sep 4, 2019  • #6
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)