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
Chris Charles
5 discussion posts
I've got an interesting one:
User of DF for years, and I'm a huge fan.

Non-DisplayFusion environment:
    A) Due to customer privacy Personal Information (PI) data >
    B) Window (Application = Remote Desktop) running on Monitor #2
    C) Window needs to be locked to Monitor #2
    D) Window cannot be displayed on Monitor #1

With DisplayFusion would like to:
    1) Force Window (Application = Remote Desktop) to always run on Monitor #2
    2) Not allow Window to be moved to Monitor #1
    3) IF Monitor #2 is disconnected = close window / shutdown application

Reading from previous discussion posts, this may be possible with a mix-mash of Monitor Profiles + Scripted Function.

Any thoughts of a DisplayFusion recipe that could accomplish this?
Jan 1, 2025 (modified Jan 2, 2025)  • #1
User Image
Chris Charles
5 discussion posts
Thought I post an update of what I have kinda working >

1) Create 2 Monitor Profiles:

a) Profile A [Single display]
b) Profile B [Dual displays]

2) Create a new custom Scripted Function to close a window (found in other discussions):

a) Scripted Function name = "Close Remote Desktop" >>>

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        windowHandle = BFS.Window.GetWindowByText("*Remote Desktop*");
        BFS.Window.Close(windowHandle);
    }
}


3) Create a new Trigger:

a) Event: " Monitor Profile Changed "
b) Monitor Profile: " Profile A "
c) Run Function: "Close Remote Desktop"


So this actually does WORK, but there is a timing issue.

When Monitor #2 is disconnected, the time it takes DisplayFusion to have Monitor Profile = "Profile A", kick in...
The window moves to Monitor #1, and is displayed there until the Monitor profile kicks in.

Is there a way, or an alternative, to speed this up, or to kill the "Windows Remote Desktop" application faster?

Thanks :laugh:
Jan 2, 2025 (modified Jan 2, 2025)  • #2
User Image
Chris Charles
5 discussion posts
Update:

Small change to #2 above >>>

I switched from a:
  • Scripted Funtion
to
  • Custom Funtion

Call a Windows Batch Script instead, to KILL the application (Remote Desktop).
Executable for Remote Desktop = "mstsc.exe":

Code

taskkill /im mstsc.exe /t /f


This ends up working a little faster, but still, the Window moves to Monitor #1, is visible for a few seconds, before the Batch File is executed and kills the process + window.

Any ideas to NOT have window move to Monitor #1 - is greatly appreciated! 8)
Jan 2, 2025  • #3
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
That's not something we support, interesting work around you found to get it close though!
Jan 2, 2025  • #4
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)