Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
gmiller
3 discussion posts
I have a situation where I am remote controlling a computer in a way that does not blank the monitors on connection. Is there a way to define a DisplayFusion function to either blank the monitors or turn their brightness to zero while still being able to use the remote connection?
Dec 18, 2014  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Unfortunately that wouldn't be possible with DisplayFusion. The only way we could blank the screen is to throw up a full screen black window, but then you wouldn't be able to see anything on the remote end either. Sorry :(
Dec 18, 2014  • #2
User Image
Collin Chaffin
69 discussion posts
I just finished writing this macro function (rewriting I use it today outside of DF) which utilizes nirsoft's nircmd. I have a question for Keith perhaps I missed in the macro docs but is there a built-in call I can make to always return the DF binaries install/execution path? I would like to utilize that in the function so that "in order to run" we can say you must always drop nircmd.exe in the DF install folder and be done, rather than having to edit paths, use system path, etc.

One I get clarification from Keith, I'll publish the code to the downloadable function library. My function will sleep all active attached monitors, and lock the workstation requiring a full unlock upon keyboard/mouse move.

EDIT: All remote functions work fine upon monitor sleep but I will also release a non-workstation-lock 2nd function which should meet your requirements as a workstation lock would impact remoting.
Collin Chaffin's profile on WallpaperFusion.com
Dec 22, 2014 (modified Dec 22, 2014)  • #3
User Image
Collin Chaffin
69 discussion posts
Here you go. I already submitted to be published to the library as well. I submitted 2 versions, the one here that sleeps all active monitors, and then also the one I use which also sleeps and initiates the workstation lock so that upon wakeup it is a full unlock required.

Assuming they approve quickly you should be able to pull it down using the settings GUI within a couple days, but if you need it sooner you can copy/paste from here (note the comment formatting is most likely screwed up in the web post):

using System;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;

//////////////////////////////////////////////////////////////////////////////////////////
////
//Author: Collin Chaffin//
////
//Description:This function sets all active monitors to S3 sleep state but//
//does NOT lock workstation.//
////
//NOTE: THIS FUNCTION UTILIZES NIRSOFT'S NIRCMD.EXE//
//DOWNLOAD FROM:http://www.nirsoft.net/utils/nircmd.html//
//COPY ONLY NIRCMD.EXE TO THE DISPLAYFUSION ROOT APPLICATION FOLDER//
//USUALLY C:\Program Files (x86)\DisplayFusion for 64 bit//
////
//////////////////////////////////////////////////////////////////////////////////////////

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Set up exe path and arguments
string path = System.Windows.Forms.Application.StartupPath;
string nircmdPath = path + "\\nircmd.exe";
string sleepArgs = "monitor async_off";
ProcessStartInfo sleep = new ProcessStartInfo();
sleep.Arguments = sleepArgs;
sleep.FileName = nircmdPath;

// Hide windows
sleep.WindowStyle = ProcessWindowStyle.Hidden;
sleep.CreateNoWindow = true;

// Disable the annoying publisher verification
sleep.UseShellExecute = false;

// Execute and wait for it to finish
using (Process proc = Process.Start(sleep))
{
proc.WaitForExit();
}

}
}
Collin Chaffin's profile on WallpaperFusion.com
Dec 22, 2014  • #4
User Image
Collin Chaffin
69 discussion posts
EDIT not sure why forum posted a reply to this thread when I was trying to reply to another, sorry!
Collin Chaffin's profile on WallpaperFusion.com
Dec 22, 2014 (modified Dec 22, 2014)  • #5
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
Collin's functions are available in DisplayFusion now too. :)
Dec 22, 2014  • #6
User Image
Collin Chaffin
69 discussion posts
Thanks Jon. Quick question maybe you can answer or add as feature request........a BFS.DisplayFusion.GetInstallPath function would be really nice. :)

I had to fall back on System.Windows.Forms.Application.StartupPath which is not always best but I also can't use traditional System.Reflection.Assembly.GetExecutingAssembly().CodeBase because it points to the GAC location and we obviously don't want users' dropping anything there. :)

So, this call works but since you guys are the pros a few additional API calls related to all things BFS.DisplayFusion (maybe version, isadmininstalled whether enterprise MSI installed/managed, etc. as well) would be really cool to have!

-Collin
Collin Chaffin's profile on WallpaperFusion.com
Dec 22, 2014  • #7
User Image
gmiller
3 discussion posts
Wow! This is pretty cool. I enabled the script, assigned it to a hotkey and sure enough, the monitors go right into sleep mode. Only problem is that the sleep mode cancels as soon as a key is pressed or the mouse moves, either directly or through a remote session.

It would be sweet if there was a way to keep the monitors sleeping while a remote session was active.
Dec 22, 2014  • #8
User Image
Collin Chaffin
69 discussion posts
Ahh so if it's a VNC-like remoting then yes I suppose that mouse-move would look the same as a local action and wake them. Let me think about it and what options might be.
Collin Chaffin's profile on WallpaperFusion.com
Dec 22, 2014  • #9
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)