Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

Brynwall's profile on WallpaperFusion.com
I have a Custom function to move Window to the Center and enlarge, but I was hoping to have a function that does the same thing, but have the start position 1/3rd from the left of the screen and enlarge to the right (I have an ultrawide monitor).

Is it possible to start at a percentage of the screen? The Alignment options seem somewhat limted and none of them would work the way I'm trying to get it to work.

I was using the Beta, but was having to many issues with these functions so I went back to standard.
2024-03-25 13_03_11-Settings _ DisplayFusion Pro on Steam 10.1.2.png
2024-03-25 13_03_11-Settings _ DisplayFusion Pro on Steam 10.1.2.png
Mar 25, 2024  • #1
Brynwall's profile on WallpaperFusion.com
options for alignment
2024-03-25 13_04_51-Edit Function _ DisplayFusion Pro on Steam 10.1.2.png
2024-03-25 13_04_51-Edit Function _ DisplayFusion Pro on Steam 10.1.2.png
Mar 25, 2024  • #2
User Image
JLJTGR
101 discussion posts
Use this as a C# scripted function:

Code

using System;
using System.Drawing;
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        Rectangle monitorRect = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle);
        BFS.Window.SetSizeAndLocation(windowHandle, (int)(monitorRect.Width * 0.33), 0, monitorRect.Width - (int)(monitorRect.Width * 0.33), monitorRect.Height);
    }
}


If you want to adjust the percentage, replace the two
0.33
with a different number instead of 33%.
Mar 26, 2024  • #3
Brynwall's profile on WallpaperFusion.com
This looks like it just sizes the windows to 33% and doesn't place it in the 33% of the monitor. Am I reading that wrong?

I've already got 3 functions that split it to the left 1/3rd, the middle 1/3rd, and the right 1/3rd, but I'm wanting the left side of the window to START in the middle left 3rd and extend right instead of starting in the middle of the screen and extending left AND right.

Quote:
Use this as a C# scripted function:

Code

using System;
using System.Drawing;
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        Rectangle monitorRect = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle);
        BFS.Window.SetSizeAndLocation(windowHandle, (int)(monitorRect.Width * 0.33), 0, monitorRect.Width - (int)(monitorRect.Width * 0.33), monitorRect.Height);
    }
}


If you want to adjust the percentage, replace the two
0.33
with a different number instead of 33%.
Mar 26, 2024 (modified Mar 26, 2024)  • #4
User Image
JLJTGR
101 discussion posts
Why don't you try it and see if it does what you want? It does what I was able to understand of your request. The function literally says it affects size and location. It uses
0.33
two times... once for left position and once to resize the window to be that much smaller than the entire screen.

Maybe draw a picture?
Mar 26, 2024 (modified Mar 26, 2024)  • #5
User Image
JLJTGR
101 discussion posts
It just occurred to me that this might not work perfectly for everyone. I have my taskbar autohide, so I didn't care about the space that the taskbar occupies. (it occupies zero) For most people, their taskbar does occupy space... so please replace
GetMonitorBoundsByWindow
with
GetMonitorWorkAreaByWindow
.
Mar 26, 2024  • #6
Brynwall's profile on WallpaperFusion.com
Ah! I didn't understand the code initially. Thank you! That Worked! These are the parameters that I used:

Code

using System;
using System.Drawing;
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        Rectangle monitorRect = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle);
        BFS.Window.SetSizeAndLocation(windowHandle, (int)(monitorRect.Width * 0.3333), 0, monitorRect.Width - (int)(monitorRect.Width * 0.55), monitorRect.Height);
    }
}
Mar 27, 2024  • #7
Brynwall's profile on WallpaperFusion.com
How do I get it to work on the CURRENT window and not go to a specific one?
3 days ago  • #8
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)