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
able16
20 discussion posts
I have a custom function for changing window size/location mapped to a key combination, but I only want it to activate for one [maybe two] programs. Since I mostly run games in borderless windowed, accidentally pressing the key combo yields unwanted results.

For a few years I've gotten by with remapping the key combination but I'm reorganizing my workflow so trying not to take the inconvienience anymore. Also don't want to do this in a roundabout way. Such as making two triggers that toggles key combinations and appending every process.

I can achieve this with one line using AutoHotKey (#IfWinActive) but would like to keep DisplayFusion as my only window manager.
Jun 13, 2024  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
If you are comfortable with scripting you should be able to do this. I've attached an example script below that will only fire the function if a Chrome window is currently focused, but you can change the app it looks for on line 16:

Code

using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger 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)
    {
        IntPtr FocusedWindow = BFS.Window.GetFocusedWindow();
        string processName = BFS.Application.GetMainFileByWindow(FocusedWindow);
        if (processName.EndsWith(chrome.exe))
        {
        BFS.DisplayFusion.RunFunction(FunctionName);
        }
    }
}
Jun 18, 2024  • #2
User Image
able16
20 discussion posts
Quote:
I've attached an example script

Thank you, this solution is within the scope of what I was looking for.
Jun 19, 2024  • #3
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)