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?

User Image
Chris G1
86 discussion posts
I use this popular jumplist code linked to a title bar button

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", "Move Window to Next Monitor" }},
{{ "White", "Black", "Span Window Across all Monitors" }},
{{ "WhiteSmoke", "Black", "Minimize Window To System Tray" }},
{{ "White", "Black", "Minimize All Windows Except Current Window (All Monitors)" }},
{{ "WhiteSmoke", "Black", "Toggle Window Always on Top" }},
{{ "White", "Black", "Lock/Unlock Mouse Cursor to Current Focused Window" }},
{{ "WhiteSmoke", "Black", "Full-Screen(Windowed)" }},

{{ "White", "Black", "Prevent Window Deactivation (keeps game windows focused)" }},
{{ "White", "Black", "Dim Second Screen" }}

};

//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);
}
}


The jumplist no longer appears and when I do a Verify Function it throws up a lot of errors. I can't seem to export them as a text file so have attached as a screenshot.

Why is this happening? Thanks.
• Attachment: Title Bar Code Errors.png [116,295 bytes]
Title Bar Code Errors.png
Title Bar Code Errors.png
Jul 30, 2024 (modified Aug 1, 2024)  • #1
User Image
Amaranth
11 discussion posts
I'm also on beta 5. I pasted the code you posted on a new function and it worked for me, no errors and I can see the jumplist.

I can't see the screenshot, but just in case, maybe you created the function as VBScript instead of C#?
Jul 31, 2024  • #2
User Image
Chris G1
86 discussion posts
Hi Amaranth,

I've unprotected the attachment and tried to create a new Scripted Function making sure to select C# but the same thing happens. I wonder if it is some sort of DLL issue?
Aug 1, 2024  • #3
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Could you send me over a debug log? Here are the steps:

  • On the DisplayFusion Settings > Troubleshooting tab, change the Logging drop-down to "L1: Log Minimal" and click Apply
  • Reproduce the issue and note the time so we'll know where to check in the log file
  • Click the "Export Info to File" button on the Settings > Troubleshooting tab
  • Reply with the file attached
  • Disable debug logging after sending the log
Aug 2, 2024  • #4
User Image
Chris G1
86 discussion posts
Here you go - reproduced at 9:56 AM
• Attachment [protected]: DisplayFusionDebugInfo.zip [141,931 bytes]
Aug 2, 2024  • #5
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Thanks for sending that over, there are a bunch of .net errors in there. Can you try re-downloading it from here and see if that fixes it? https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-8.0.7-windows-x64-installer
Aug 2, 2024  • #6
User Image
Chris G1
86 discussion posts
Thank you - that worked!
Aug 2, 2024  • #7
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)