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
Snacko
19 discussion posts
Just that.. I've been trying to write a function to call from a trigger, but it's been a long time since I've done any programming. Seems like someone might have done this already? I want to hide the Titlebar Buttons when the window is less than a certain width. So far I've got this. But it just toggles it on and off globally on all windows.

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)
    {    
        //get the bounds of the current window
        Rectangle windowBounds = BFS.Window.GetBounds(windowHandle);
        {
        //if the window is less than X
        if(windowBounds.Width<200)        // Toggle the TitleBar Buttons
            BFS.DisplayFusion.RunFunction("Toggle TitleBar Buttons");
         //   BFS.DisplayFusion.RunFunctionWithWindowHandle
        }
    }
}
May 20, 2020  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
No need for a Trigger rule for this, there's an Advanced Setting that does this :)

In Settings > Advanced Settings, set the width in pixels on this setting:
TitleBar Buttons: Minimum Window Width


Hope that helps!
May 20, 2020  • #2
User Image
Snacko
19 discussion posts
Awesome!! Thanks!!
May 21, 2020  • #3
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)