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
Peter Bukewicz
14 discussion posts
I understand we already have the feature to have software open on specified monitors, but if the software is already open and I'm simply changing monitor profiles I'd like certain ones to stay on the monitors I want. Sorry if this sounds confusing, but this would be a really great addition to DisplayFusion!
Oct 27, 2015  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
How many applications do you want to do this for? This may be possible with a Scripted Function :)
Oct 28, 2015  • #2
User Image
Peter Bukewicz
14 discussion posts
It's usually with about 4-5 programs that i have to switch back over whenever I change profiles. For instance, I have 2 monitors and a TV that's behind me. Whenever I switch to a profile that includes the TV most of the programs I have open will automatically switch to the TV, when I would rather it stay on one of my dual monitors.
Oct 28, 2015  • #3
User Image
Jcee
205 discussion posts

Code

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

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{

//Put the number of screens you have here V excluding your tv.
if (BFS.Monitor.GetMonitorIDs().Length >  1)
{
//Put the name of your profile that doesnt include your TV where "Bed" is
BFS.DisplayFusion.LoadMonitorProfile("Bed");

}
else
{
//put the name of the profile including your extra TV where "Desk" is
BFS.DisplayFusion.LoadMonitorProfile("Desk");

IntPtr[] handles = BFS.Window.GetVisibleWindowHandles();
BFS.General.Sleep(100);
for (int i = 0; i < handles.Length; i++)
//Because the forum is being dumb, replace the {} at the end of the below line with []
BFS.Window.MoveToMonitor(2, handles{i});
}

}
}


This might suite your needs, it moves everything to your primary monitor after loading one of 2 monitor profiles
Any line with a // is a comment, and needs your specific info

Also @ keith: Im recieving an error "You have an open {i} with no matching closing {/i} tag preventing me from posting the CODE without amendment
Oct 29, 2015  • #4
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Thanks for posting that Jcee!

Did you get that error when trying to paste the code without the CODE tags?
Oct 29, 2015  • #5
User Image
Peter Bukewicz
14 discussion posts
Thanks! I'll give it a shot and I'll update on how it goes.
Oct 29, 2015  • #6
User Image
Peter Bukewicz
14 discussion posts
----
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{

//Put the number of screens you have here V excluding your tv.
if (BFS.Monitor.GetMonitorIDs().Length > 1)
{
//Put the name of your profile that doesnt include your TV where "Bed" is
BFS.DisplayFusion.LoadMonitorProfile("Dual Monitor");

}
else
{
//put the name of the profile including your extra TV where "Desk" is
BFS.DisplayFusion.LoadMonitorProfile("Main + TV");

IntPtr[] handles = BFS.Window.GetVisibleWindowHandles();
BFS.General.Sleep(100);
for (int i = 0; i < handles.Length; i++)
//Because the forum is being dumb, replace the {} at the end of the below line with []
BFS.Window.MoveToMonitor(2, handles{i});
}

}
}
-----------

It doesn't seem to work, or I didn't do it right. Any idea on what I did wrong? :| I did replace {i} with brackets as well. I'm not familiar with scripting.
Oct 31, 2015  • #7
User Image
Jcee
205 discussion posts
//Because the forum is being dumb, replace the {} at the end of the below line with []
BFS.Window.MoveToMonitor(2, handles{i});

Possibly..
it needs to say Handles[ i ] (without spaces
Nov 1, 2015 (modified Nov 1, 2015)  • #8
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)