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
sane
7 discussion posts
Hello,

Do you know if it is possible to launch automatically the same programs / windows in the same locations with display fusion?

I have 3 screens. Every day when I turn on the computer, I open two windows chrome on the right screen to display twitter and google calendar
On the left screen, double windows explorer, and on the main screen, two chrome windows again, with my main navigation window on the right side at 70% of the screen (thanx monitor configuration) and another one to often display a site that I refresh automatically.

It becomes painful to do that every day, to open everything up, to organize..

Is there a way with display fusion to do the same thing, like recording all this as a kind of session and reopen it all at once?

I used sometimes a script found here to open two explorer instances, but i'm not able to adapt this to ad multiple chrome windows with specifics websites to open where i want

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
public static void Run()
{
//Open the first Explorer instance and move it to the left half of monitor 3
BFS.Application.Start("C:\\Windows\\explorer.exe");
BFS.General.ThreadWait(1000);
IntPtr windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(1, windowHandle);
BFS.General.ThreadWait(250);
BFS.Window.MoveToLeftMonitorHalf(windowHandle);

//Open the first Explorer instance and move it to the left half of monitor 3
BFS.Application.Start("C:\\Windows\\explorer.exe", "D:");
BFS.General.ThreadWait(1000);
windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(1, windowHandle);
BFS.General.ThreadWait(250);
BFS.Window.MoveToRightMonitorHalf(windowHandle);
}
}


Thanx :)
Thank you
Aug 3, 2017 (modified Aug 3, 2017)  • #1
User Image
sane
7 discussion posts
i tried something like this, but i have
-an error message on line 27 and 43 with 'windowHandle'
- my center screen if 30% left and 70% right with windows management, but the script open the windows on left and right in this 30% and don't respect the 30/70 ratio

I think it could be the solution, but i don't really know how to correct :D

Thanx :)

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
public static void Run()
{
//Open the first Explorer instance and move it to the left half of monitor 3
BFS.Application.Start("C:\\Windows\\explorer.exe");
BFS.General.ThreadWait(1000);
IntPtr windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(1, windowHandle);
BFS.General.ThreadWait(250);
BFS.Window.MoveToLeftMonitorHalf(windowHandle);

//Open the first Explorer instance and move it to the left half of monitor 3
BFS.Application.Start("C:\\Windows\\explorer.exe", "D:");
BFS.General.ThreadWait(1000);
windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(1, windowHandle);
BFS.General.ThreadWait(250);
BFS.Window.MoveToRightMonitorHalf(windowHandle);

//Open the first Explorer instance and move it to the left half of monitor 2 (center)
BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "/new-window \"https://www.dealabs.com/\"");
BFS.General.ThreadWait(1000);
IntPtr windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(2, windowHandle);
BFS.General.ThreadWait(250);
BFS.Window.MoveToLeftMonitorHalf(windowHandle);

//Open the second Explorer instance and move it to the right half of monitor 2 (center)
BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "/new-window \"https://www.google.fr/\"");
BFS.General.ThreadWait(1000);
windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(2, windowHandle);
BFS.General.ThreadWait(250);
BFS.Window.MoveToRightMonitorHalf(windowHandle);

//Open the first Explorer instance and move it to the left half of monitor 3 (right)
BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "/new-window \"https://www.yahoo.fr/\"");
BFS.General.ThreadWait(1000);
IntPtr windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(3, windowHandle);
BFS.General.ThreadWait(250);
BFS.Window.MoveToLeftMonitorHalf(windowHandle);

//Open the second Explorer instance and move it to the right half of monitor 3 (right)
BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "/new-window \"https://www.duckduckgo.com/\"");
BFS.General.ThreadWait(1000);
windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(3, windowHandle);
BFS.General.ThreadWait(250);
BFS.Window.MoveToRightMonitorHalf(windowHandle);
}
}
Aug 3, 2017 (modified Aug 3, 2017)  • #2
Keith Lammers (BFS)'s profile on WallpaperFusion.com
We're planning to add an official feature for this type of thing in the future, so I will add your vote :)

For your script, take out the "IntPtr " at the start of lines 27 and 43, since windowHandle was already declared earlier in the script.

For the 30/70 sizing, are you using Monitor Splits for that?
Aug 4, 2017  • #3
User Image
sane
7 discussion posts
Hi :)

You have my vote :)

Its ok for the script now, but i have a strange problem, sometimes the chrome windows said that i'm not connected to the internet when i use the script, sometimes its ok.
If i open multiples chrome windows manually, its ok

For the 30/70 on the main screen and 3.1 on the right screen yes i use the monitor split settings in DF
I think i need to add some parameters to specify the 30/70, 3x1 on each screen but i dont know how

thx :)
Aug 4, 2017  • #4
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You can replace the BFS.Window.MoveToMonitor with something like this:

BFS.Window.MoveToMonitorMaximized(201, windowHandle);

The above example assumes that you want to maximize the window on monitor split 2.1.

Regarding Chrome saying there's no internet connection, I can't even imagine what that would be, sorry! DisplayFusion just says "Launch chrome.exe with this URL," nothing fancy going on there :(
Aug 4, 2017  • #5
User Image
sane
7 discussion posts
and what is the command to add to fit with the monitor split settings that i configure?

I use this settings on the right screen sometimes with a 3x1
https://image.noelshack.com/fichiers/2017/31/7/1502053323-2017-08-06-22-58-20.png


And usualy this one on my primary screen
https://image.noelshack.com/fichiers/2017/31/7/1502053323-2017-08-06-22-58-36.png


or sometimes this one:

https://image.noelshack.com/fichiers/2017/31/7/1502053324-2017-08-06-22-59-47.png


Thanx for your help :)
Aug 6, 2017  • #6
User Image
sane
7 discussion posts
Quote:
You can replace the BFS.Window.MoveToMonitor with something like this:

BFS.Window.MoveToMonitorMaximized(201, windowHandle);

The above example assumes that you want to maximize the window on monitor split 2.1.

Regarding Chrome saying there's no internet connection, I can't even imagine what that would be, sorry! DisplayFusion just says "Launch chrome.exe with this URL," nothing fancy going on there :(


Ok it does not work, the window was not moved on the right screen and did not get to the right size.
In addition, always this big problem that makes the windows open chrome with this code do not connect on the internet and that makes all this useless :(
Aug 6, 2017  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, let me see if I can do up a Scripted Function that might work a bit better. Can you let me know the following?
  • For regular applications, let me know the full path to their EXE, and what monitor split you want them to be on.
  • For websites, let me know the website URLs and what monitor split you want them to be on.

If you want to email these details to keep them private, please send them to support@binaryfortress.com and refer to this Discussions topic.
Aug 9, 2017  • #8
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)