Processing Ajax...
Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Possible Solution for Multi Titlebar buttons and containers

User Image
Redbooper
9 discussion posts
So it looks like this has been a problem for a long time.
https://www.displayfusion.com/Discussions/View/feature-request-add-a-special-titlebar-button-that-when-clicked-acts-as-a-vertical-container-for-others-titlebar-buttons/?ID=c52621f6-8ad9-46b1-8222-015f7964f476
https://www.displayfusion.com/Discussions/View/a-suggestion-to-improve-the-usability-of-the-titlebar-buttons/?ID=2fc20993-50eb-4dce-b08f-0813639083c3
I may have a workaround. Based on the work in the first link.
1. Use Unicode Characters to Describe the function and therefore the use it as an Icon.
2. Rename functions according to unicode graphic description.
3. Create new icons for your custom menus.
For Vertical and Horizontal shifting of Windows

Code

using System;
using System.Drawing;
using System.Windows.Forms;
// 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)
{
//these are all of the functions from the "Window Management" functions list
//the function are just called by their names. to find their names, you can copy them
//from the context menus, or type "BFS.DisplayFusion.RunFunction(" and a window will come up
//with all of the available functions
//"--- Abbrechen ---" is german for "cancel". Used to cancel the action, see below "MenuItem_Click"
BFS.DisplayFusion.RunFunction("Prevent Window Deactivation (keeps game windows focused)");
string[, ,] MenuEntries =
{
//{{ "Background-Color", "Foreground-Color", "Function-Name", }}
{{ "WhiteSmoke", "Black", "🢁" }},
{{ "WhiteSmoke", "Black", "🢀" }},
{{ "WhiteSmoke", "Black", "🢂" }},
{{ "WhiteSmoke", "Black", "🢃" }},
};
//create a new ContextMenuStrip to show the items
using(ContextMenuStrip menu = new ContextMenuStrip())
{
//dont show the padding on the left of the menu
menu.ShowCheckMargin = false;
menu.ShowImageMargin = false;
//add items to the menu, and use our custom function when a user clicks on the items
for ( int i = 0; i < ( MenuEntries.Length / MenuEntries.Rank ); i++ )
{
menu.Items.Add(MenuEntries[i, 0, 2]);
menu.Items[menu.Items.Count - 1].Click += MenuItem_Click;
menu.Items[menu.Items.Count - 1].BackColor = Color.FromName( MenuEntries[i, 0, 0]);
menu.Items[menu.Items.Count - 1].ForeColor = Color.FromName( MenuEntries[i, 0, 1]);
}
//if the menu will show on the screen, show it. otherwise, show it above the mouse
if(BFS.Monitor.GetMonitorBoundsByMouseCursor().Contains(new Point(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY() + menu.Height)))
menu.Show(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY());
else
menu.Show(new Point(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY()), ToolStripDropDownDirection.AboveRight);
//set focus to the menu
BFS.Window.Focus(menu.Handle);
//wait for the menu to close
while(menu.Visible)
Application.DoEvents();
BFS.DisplayFusion.RunFunction("Prevent Window Deactivation (keeps game windows focused)");
}
}
//this function will get the text of the item and try to run it as a DisplayFusion function
//"--- Abbrechen ---" (Cancel), change it to what you used in MenuEntries-List
private static void MenuItem_Click(object sender, EventArgs e)
{
ToolStripItem item = sender as ToolStripItem;
if (item == null || item.Text == "--- Abbrechen ---")
return;
BFS.DisplayFusion.RunFunction(item.Text);
}
}

Diagonal

Code

using System;
using System.Drawing;
using System.Windows.Forms;
// 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)
{
//these are all of the functions from the "Window Management" functions list
//the function are just called by their names. to find their names, you can copy them
//from the context menus, or type "BFS.DisplayFusion.RunFunction(" and a window will come up
//with all of the available functions
//"--- Abbrechen ---" is german for "cancel". Used to cancel the action, see below "MenuItem_Click"
BFS.DisplayFusion.RunFunction("Prevent Window Deactivation (keeps game windows focused)");
string[, ,] MenuEntries =
{
//{{ "Background-Color", "Foreground-Color", "Function-Name", }}
{{ "WhiteSmoke", "Black", "🢅" }},
{{ "WhiteSmoke", "Black", "🢄" }},
{{ "WhiteSmoke", "Black", "🢆" }},
{{ "WhiteSmoke", "Black", "🢇" }},
};
//create a new ContextMenuStrip to show the items
using(ContextMenuStrip menu = new ContextMenuStrip())
{
//dont show the padding on the left of the menu
menu.ShowCheckMargin = false;
menu.ShowImageMargin = false;
//add items to the menu, and use our custom function when a user clicks on the items
for ( int i = 0; i < ( MenuEntries.Length / MenuEntries.Rank ); i++ )
{
menu.Items.Add(MenuEntries[i, 0, 2]);
menu.Items[menu.Items.Count - 1].Click += MenuItem_Click;
menu.Items[menu.Items.Count - 1].BackColor = Color.FromName( MenuEntries[i, 0, 0]);
menu.Items[menu.Items.Count - 1].ForeColor = Color.FromName( MenuEntries[i, 0, 1]);
}
//if the menu will show on the screen, show it. otherwise, show it above the mouse
if(BFS.Monitor.GetMonitorBoundsByMouseCursor().Contains(new Point(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY() + menu.Height)))
menu.Show(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY());
else
menu.Show(new Point(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY()), ToolStripDropDownDirection.AboveRight);
//set focus to the menu
BFS.Window.Focus(menu.Handle);
//wait for the menu to close
while(menu.Visible)
Application.DoEvents();
BFS.DisplayFusion.RunFunction("Prevent Window Deactivation (keeps game windows focused)");
}
}
//this function will get the text of the item and try to run it as a DisplayFusion function
//"--- Abbrechen ---" (Cancel), change it to what you used in MenuEntries-List
private static void MenuItem_Click(object sender, EventArgs e)
{
ToolStripItem item = sender as ToolStripItem;
if (item == null || item.Text == "--- Abbrechen ---")
return;
BFS.DisplayFusion.RunFunction(item.Text);
}
}

Copy the unicode character for your functions and rename the function to that.
That then reduced the titlebar width.
Then go to your Display Fusion buttons folder and create a new foler and icons for your sets.
Icons attached (white)
One odd issue is that some unicode characters are not shown in DF functions list properly but it still works.
If anyone knows how to add an icon to the menu item and then display it in the menu rather than the function name that would solve a low of problems.:
//{{ "Background-Color", "Foreground-Color", "Function-Name", }}
{{ "WhiteSmoke", "Black", "Actual Custome Name", "Icon.png" }},

Attached 2 WHITE icons for the titlebar, just invert them for black.
• Attachment: cross arrow diag.png [487 bytes]
cross arrow diag.png
• Attachment: cross arrow.png [323 bytes]
cross arrow.png
• Attachment: menu example 2.png [1,384 bytes]
menu example 2.png
• Attachment: menus example.png [2,735 bytes]
menus example.png
Aug 29, 2022 (modified Aug 29, 2022)  • #1
Was this helpful?  Login to Vote(-)  Login to Vote(-)