Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Jcee
205 discussion posts
Jumplist functions dont seem to be visible on windows 8.1s regular task-bar for me.. And since I dont use the display fusion taskbar, I dont get access to them at all (except through shortcuts, or those 'titlebar buttons, which are buggy, and I would prefer not to use)

If Possible I would prefer it if functions could be added to the context menu that displays when you right click the titlebar for a window
Jun 6, 2015  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
We would love to have them on the Windows taskbar as well, but unfortunately it's not possible at the moment, due to technical limitations in Windows :(

However, if there's a way to do it in the future, we will definitely be adding the DisplayFusion functions to the jump lists on the Windows taskbar :)
Jun 8, 2015  • #2
User Image
Jcee
205 discussion posts
What about adding to the right click context when clicking the title-bar? (or if thats not possible, creating your own context menu that fires when you hold ctrl, and right click)
I've already got so many hotkeys to worry about, that its not worth having them for every function @.@ but 1 hotkey to bring up a customizable list of functions wouldnt be so bad
Jun 8, 2015  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
That actually may be do-able and is on our list to do. I'll definitely let you know if we're able to implement it :)

Would you be interested in a Scripted Function that pops up a dialog box asking you to choose a function from a list? You'd be able to customize the script to show whichever functions you like in the list.
Jun 9, 2015  • #4
User Image
Jcee
205 discussion posts
That would indeed be a useful solution, if it were easily customizable, and looked decent with 20~ options
Jun 9, 2015  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, great! I'll let you know was soon as we have a sample script available.
Jun 10, 2015  • #6
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, here you go! Just customize the list in the script with whatever functions you like :)
• Attachment: Show_Custom_Function_List.txt [1,778 bytes]
Jun 11, 2015  • #7
User Image
Jcee
205 discussion posts
Works great, and is easily customizable, thanks. The only improvement I could even think of would be reducing it to 1 click. (Showing the list immediately when the hotkey is pressed, and running the function without an 'ok' confirmation)

Ill definitely be using it, however :)
Jun 11, 2015  • #8
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Sure! Give the attached one a go :)
• Attachment: Show_Custom_Function_List_One_Click.txt [2,806 bytes]
Jun 12, 2015  • #9
User Image
Jcee
205 discussion posts
Wow, absolutely awsome :) you should definitely add it to the scripted functions list :) simple, yet extremely useful
Jun 12, 2015  • #10
User Image
DS1508
37 discussion posts
Hello there.
I just tried your OnClick code, it works very good. But the ContextMenuWindow is below the active window, where i clicked the button. So I cant see it. Is it possible to bring the context window to front? how?

--- EDIT ---
Ok, I've played around with your script and changed it a little bit.
- Added Background and Foreground Colors
- Added set focus (my window was always behind the calling one)
• Attachment: ShowCustomFunctionList MoveWin.txt [3,551 bytes]
Jun 13, 2015 (modified Jun 13, 2015)  • #11
User Image
DS1508
37 discussion posts
Sorry, it's still not always working. Often the menu is still below the calling window. Do you have an idea how we could solve this?
Jun 14, 2015  • #12
User Image
Jcee
205 discussion posts
Not having that problem myself, in-fact its above everything else, full-screen(windowed games), metro UI, and even the other system right click context menu's And Im calling it with both a hotkey, and a title-bar button.

Also after using it, for a couple days I've got some more feed-back/suggestions to help improve it:

The menu doesn't disappear until you use a function. It should have focus, and disappear when its lost (IE when you click outside of the context menu) This issue is slightly annoying but not vital, as you usually intend to use it when you call it (and you can add a 'dummy' function titled 'close' if you decide you dont want to activate any other functions

Also something fixed with DS's version; Because the window has focus, you can use keyboard shortcuts with it...
Jun 14, 2015 (modified Jun 14, 2015)  • #13
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@DS: Which version of Windows are you running? I have this issue on Windows 10, but not in Windows 8 or 7.
Jun 15, 2015  • #14
User Image
DS1508
37 discussion posts
I'm using Windows 7 Ultimate (all/latest patches) with 1 Screen 1920x1080.

And atm it's not working. Just tried it again, and every menu was below the calling window, when using titlebar button. With a hotkey the menu shows on top, next to the mouse pointer.
Jun 16, 2015  • #15
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Strange! Works every time for me. Could you attach a copy of your troubleshooting info?
  • Open the DisplayFusion Settings > Troubleshooting tab
  • Click the Copy to Clipboard button
  • Open Notepad, paste the text, and save the file
  • Reply with the text file attached
Jun 16, 2015  • #16
User Image
DS1508
37 discussion posts
Here it is. :)
• Attachment [protected]: trouble.txt [78,493 bytes]
Jun 17, 2015  • #17
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Thanks! Everything there looks ok. Which application windows are you trying it on? I just tested with Windows Explorer, but maybe the issue is specific to certain applications?
Jun 17, 2015  • #18
User Image
DS1508
37 discussion posts
No, it happens on every window.
I tried Firefox, Windows Explorer, Chrome, Process Explorer, and others. The Menu is always below. :-[
Jun 17, 2015  • #19
Keith Lammers (BFS)'s profile on WallpaperFusion.com
If you add this below your SetFocus line, does that help?

BFS.Window.SetAlwaysOnTop(menu.Handle, true);
Jun 18, 2015  • #20
User Image
DS1508
37 discussion posts
No, sorry, did not work. See screenshot.

It's still below the window. And like you can see, it's useless.
• Attachment: DF_scn.jpg [209,015 bytes]
DF_scn.jpg
DF_scn.jpg
Jun 18, 2015  • #21
Keith Lammers (BFS)'s profile on WallpaperFusion.com
I may have found a dirty workaround. Could you try this instead of just BFS.Window.Focus?

Code

//set focus to the menu
Rectangle menuBounds = BFS.Window.GetBounds(menu.Handle);
BFS.Window.Focus(menu.Handle);
BFS.General.ThreadWait(50);
BFS.Input.SetMousePosition(menuBounds.X + 1, menuBounds.Y + 1);
BFS.Input.LeftClickMouse();
Jun 19, 2015  • #22
User Image
DS1508
37 discussion posts
Lol, this is a funny thing. But, no, it's not working. See screenrecord.
• Attachment: DF_Menu.mp4 [409,911 bytes]
Jun 20, 2015  • #23
User Image
Jcee
205 discussion posts
Just a hunch, but have you tried the 'always on top' function to see if its working perfectly? If-so what if you applied it to that window?
Jun 20, 2015  • #24
User Image
DS1508
37 discussion posts
Yes, I tried this too. See Screenshot.
I don't know what this is, but nothing works. (Till now)

Edit:
When using a hotkey, everything's ok. But when I click on the Titlebar Button, the menu is always below the window. Every window, Explorer, Browsers, ...
Jun 20, 2015 (modified Jun 20, 2015)  • #25
User Image
Jcee
205 discussion posts
do you have any other functions or programs running that might be trying to force something to the forground, or prevent window deactivation? try booting into safe-mode and start display fusion and see if the problem still exist?
Jun 21, 2015  • #26
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Hah! I said it was a dirty workaround ;)

I actually had that issue with my workaround a couple of times, but it mostly worked for me. Must be a timing related thing.

I think this issue has something to do with the titlebar button z-order code in DisplayFusion. I can't reproduce it in Windows 7, but I can in Windows 10, so I'm hoping that if we can fix it there, it will fix it up for you as well.

I've put it on our list, and I'll keep you posted when we've had a chance to work on it.

Thanks!
Jun 23, 2015  • #27
User Image
Jcee
205 discussion posts
Im pretty sure I solved the issue you were having DS1508, by throwing this, at the start, and end of the function:

BFS.DisplayFusion.RunFunction("Prevent Window Deactivation (keeps game windows focused)");

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);
}
}
Jul 9, 2015  • #28
User Image
cryodream
4 discussion posts
All I want to say is Thank You, the developers and community.

I came to forums to ask if there was a way to do exactly this sort of thing. And I found this thread.

Stupid me, I have completely forgotten, that DisplayFusion let's you code your own functions, in c# no less (my favorite language). Now that I think about it, I remember it was one if not the most important things that I liked, when I bought the software. Or rather I was deciding, if I want to try it out, because I have bought and went through the most of the popular monitor managers over the years and I was tired of switching and learning ins and outs of another one, all over again. But when I saw custom functions in c#, I remember buying right then and there. The funny thing is, I was probably busy to play with it straight away, so I didn't. And then I completely forgot about it. F*** me.

Anyway. What can I say more: although it's was the first time of me messing with it - it took me all but 10 minutes. Downloaded both scripts from the Keith and DS. using them as example, just made the changes to suit me. DS, thanks for the colors - very nice and very handy to differentiate between the "groups" of functions, and the "close" functionality.
Between that, and the most user-friendly "in-built" scripting GUI, with the debugger (verify), in 10 minutes I had exactly what I came here for and works like a charm.

Once again, to the devs of displayfusion - thank You. I have many times used displayfusion as an example of superb software at an awesome price and with very reasonable licence options. Now I feel, like I have even better reasons for keep usingit it as an example, for how software should be done and priced. Kudos!
Jun 1, 2016  • #29
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@cryodream: Thanks for the kind words, glad to hear you're enjoying DisplayFusion and the Scripted Functions!
Jun 2, 2016  • #30
User Image
Chris G1
82 discussion posts
I am running 9.4 Beta 2 on Windows 10 (version 1803, build 17134.228) and using this custom function (downloaded within DF) and have it linked to a TitleBar button. It works the first time and then each subsequent time the menu disappears very shortly after clicking the associated Titlebar button.

I tried Jcee's fix and that did not work either.

Any ideas?

Also, how do I stop the systray notifications popping up each time I click the associated Titlebar button?

Thanks.
Aug 28, 2018  • #31
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Been a while since I looked at this script! I ran into the same issue as you here, and I think I've fixed it by changing line 61 from:

Code

BFS.Window.Focus(menu.Handle);


to

Code

BFS.Window.ToggleAlwaysOnTop(menu.Handle);


Regarding the notifications, you can disable them with the "Don't Show Tray Icon Notification Balloons" option in the Settings > Advanced Settings window.
Aug 29, 2018  • #32
User Image
Chris G1
82 discussion posts
Thanks Keith - unfortunately still having the same problem. The menu appears to fall behind the window within a second.
Aug 29, 2018  • #33
Keith Lammers (BFS)'s profile on WallpaperFusion.com
I'm not sure what else to try here. I could modify the script so that it shows the functions in a pop-up dialog instead of trying to build the menu over the titlebar button. Would that that fit your workflow?
Sep 5, 2018  • #34
User Image
Newton Tavares Viegas
2 discussion posts
Hi Keith,
Is it possible to add a custom function at the popup windows? Another point is that if I click on the button as a mistake, I wasn`t able to "escape" the menu without taking an action...
Jul 29, 2020  • #35
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@Newton: The context menu from the TitleBar Buttons doesn't seem to work that great, due to z-order issues and things like that.

If I could write a Scripted Function that would pop up a dialog box with a list of functions that you could choose from, instead of a context menu, would that work for you?
Jul 29, 2020  • #36
User Image
Newton Tavares Viegas
2 discussion posts
Hi Keith... I was able to add the custom functions to the context menu. Now, the only thing that I still would need is a way to "escape" from the menu if I click on it as mistake (maybe an option like DO NOTHING if escape is not possible?)... Thanks.
Aug 2, 2020  • #37
Keith Lammers (BFS)'s profile on WallpaperFusion.com
I'm not sure if there's a way to have it close with the escape key, but you could add a blank entry, then it will just do nothing. In the MenuEntries array near the top of the script, you can add something like this:
{{ "White", "Black", "Cancel" }},
Aug 4, 2020  • #38
User Image
Chris G1
82 discussion posts
@Keith - on a side note, I would be interested in the dialog box option. I've been trying to reuse this by placing my taskbars back to vertical but still haven't been able to consistently get the menu to appear. In your own time, of course!
Aug 4, 2020  • #39
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@Chris: No problem, will do. I found a bug when opening the filtered list window from a titlebar button as well, so we'll want to fix that up first :)
Aug 5, 2020  • #40
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, try this scripted function out. Don't forget to update to 9.7.1 Beta 4 :)
Aug 19, 2020  • #41
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Interestingly, the fix we added in 9.7.1 Beta 4 for the dialog box also resolves the issue with the menu from the script in post #11. It now stays on top when you run it from a TitleBar Button as well :)
Aug 19, 2020  • #42
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(4)  Login to Vote(-)