Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
mat23
13 discussion posts
Hi,

I'm still trying to get something to work in DisplayFusion, it doesn't seem to like me. I am now trying to get Steam Big Picture to launch on my TV, instead of my monitor, I am using the custom function in the library.

I've created a monitor profile called Big Screen Gaming Profile, when i switch to this profile it should set my TV to 30hz instead of 24hz and then trigger the custom function. I have amended the variables in the function as follows and kept the rest of it the same.

When I switch the monitor profile the hz of the TV changes successfully the 2nd monitor doesn't become primary, steam does not even maximise let alone switch to big picture.

Code

using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Window Location target when run by a Window Location 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)
{
//replace these variables with ones that will work on your system
string defaultProfile = "Standard Profile";
string bigPictureProfile = "Big Screen Gaming Profile";
string steamDirectory = @"C:\\Program Files (x86)\\Steam\\Steam.exe";
const int waitForever = 0;

// get current profile name
string currentProfileName = BFS.DisplayFusion.GetCurrentMonitorProfile();
if(currentProfileName == "randomspam")
currentProfileName = defaultProfile;

// close Steam if it is running
uint steamID;
bool wasSteamRunning = BFS.Application.IsAppRunningByFile(steamDirectory);
if(wasSteamRunning)
{
steamID = BFS.Application.GetAppIDByFile(steamDirectory);
BFS.Application.Kill(steamID);

// wait for Steam to exit
BFS.Application.WaitForExitByAppID(steamID, waitForever);
}

// wake up the monitors
BFS.General.WakeMonitors();

// load the big picture monitor profile and wait for it to switch
BFS.DisplayFusion.LoadMonitorProfile(bigPictureProfile);
string profileName = BFS.DisplayFusion.GetCurrentMonitorProfile();
while(!profileName.Equals(bigPictureProfile, StringComparison.OrdinalIgnoreCase))
{
BFS.General.ThreadWait(100);
profileName = BFS.DisplayFusion.GetCurrentMonitorProfile();
}

// start Steam in Big Picture mode
steamID = BFS.Application.Start(steamDirectory, "-bigpicture");

// wait for Steam to exit
BFS.Application.WaitForExitByAppID(steamID, waitForever);

// restart Steam in normal mode
if(wasSteamRunning)
BFS.Application.Start(steamDirectory, "");

// wake up the monitors
BFS.General.WakeMonitors();

// load the last running monitor profile and wait for it to switch
BFS.DisplayFusion.LoadMonitorProfile(currentProfileName);
}
}


Any ideas?

Cheers
• Attachment [protected]: Steamtrigger.PNG [27,863 bytes]
Jan 17, 2017  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
I noticed this line in your script:

Code

if(currentProfileName == "randomspam")


Is "randomspam" the name of the Monitor Profile you're on before you run that Scripted Function?
Jan 18, 2017  • #2
User Image
mat23
13 discussion posts
Hi Keith, actually no it isn't, I thought it was referring to my steam profile, that was an error.

So I've changed it to be the monitor profile which is simply called "Standard Profile". However the end result is still the same, I get a success message from Display Fusion telling me the "Steam Big Picture Gaming" profile has loaded but Steam just sits there on the same monitor, nothing further happens.
Jan 29, 2017  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ah! It might be an issue with this line:

string steamDirectory = @"C:\\Program Files (x86)\\Steam\\Steam.exe";

Can you try changing it to either this:

string steamDirectory = "C:\\Program Files (x86)\\Steam\\Steam.exe";

or this:

string steamDirectory = @"C:\Program Files (x86)\Steam\Steam.exe";
Jan 31, 2017  • #4
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)