<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>DisplayFusion RSS: Add Window Positions Profile to existing Functions Popup menu</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=019092e9-cd07-71b2-a450-e7a3e7765b1a" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=019092e9-cd07-71b2-a450-e7a3e7765b1a</link>
<description>DisplayFusion RSS: Add Window Positions Profile to existing Functions Popup menu</description>
<lastBuildDate>Fri, 22 May 2026 21:59:01 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=019092e9-cd07-71b2-a450-e7a3e7765b1a</generator>
<item>
<title>RE: Add Window Positions Profile to existing Functions Popup menu</title>
<link>https://www.displayfusion.com/Discussions/View/add-window-positions-profile-to-existing-functions-popup-menu/?ID=019092e9-cd07-71b2-a450-e7a3e7765b1a#3</link>
<pubDate>Tue, 09 Jul 2024 16:06:15 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/add-window-positions-profile-to-existing-functions-popup-menu/?ID=019092e9-cd07-71b2-a450-e7a3e7765b1a#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Great, thanks!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Great, thanks!
</div>
]]></content:encoded>
<media:thumbnail url="https://www.displayfusion.com/Discussions/Download/?ID=019092e9-ce99-7291-8fcd-2a4d83a89811"/>
</item>
<item>
<title>RE: Add Window Positions Profile to existing Functions Popup menu</title>
<link>https://www.displayfusion.com/Discussions/View/add-window-positions-profile-to-existing-functions-popup-menu/?ID=019092e9-cd07-71b2-a450-e7a3e7765b1a#2</link>
<pubDate>Tue, 09 Jul 2024 15:25:16 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/add-window-positions-profile-to-existing-functions-popup-menu/?ID=019092e9-cd07-71b2-a450-e7a3e7765b1a#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[Yep you can add this to the list of functions you already have:
Code
Copy
Select All
Load Window Position Profile: ProfileName]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Yep you can add this to the list of functions you already have:<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019e51b2ee117360b530795e8ea82ffa" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019e51b2ee117360b530795e8ea82ffaJs'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019e51b2ee117360b530795e8ea82ffaJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">Load Window Position Profile: ProfileName</pre><textarea id="code019e51b2ee117360b530795e8ea82ffa" name="code019e51b2ee117360b530795e8ea82ffa" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
<media:thumbnail url="https://www.displayfusion.com/Discussions/Download/?ID=019092e9-ce99-7291-8fcd-2a4d83a89811"/>
</item>
<item>
<title>Add Window Positions Profile to existing Functions Popup menu</title>
<link>https://www.displayfusion.com/Discussions/View/add-window-positions-profile-to-existing-functions-popup-menu/?ID=019092e9-cd07-71b2-a450-e7a3e7765b1a</link>
<pubDate>Mon, 08 Jul 2024 15:15:14 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/add-window-positions-profile-to-existing-functions-popup-menu/?ID=019092e9-cd07-71b2-a450-e7a3e7765b1a</guid>
<category>DisplayFusion</category>
<description><![CDATA[I have the below, existing popup menu... Is it possible to code in a selection option for a specific Window Positions Profile to it?
Code
Copy
Select All
using System;
using System.Drawing;
using System.Windows.Forms;
// The 'windowHandle' parameter will contain the window handle for the:...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I have the below, existing popup menu... Is it possible to code in a selection option for a specific Window Positions Profile to it?<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019e51b2ee197546b65e9e8e56b7e3d4" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019e51b2ee197546b65e9e8e56b7e3d4Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019e51b2ee197546b65e9e8e56b7e3d4Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">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 namess. 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
        string[] functions = 
        {
            "Save Window Positions",
            "Restore Window Positions From Last Save",
            "Move Window to Center of Monitor",
            "Toggle Window Always on Top",
            "Send Window to Back",
            "Toggle Window Transparency",
            "Move All Windows to Current Monitor",
        };
        
        //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
            foreach(string function in functions)
            {
                menu.Items.Add(function);
                menu.Items[menu.Items.Count - 1].Click += MenuItem_Click;
            }
            
            //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);
                
            //wait for the menu to close
            while(menu.Visible)
                Application.DoEvents();
        }
    }
    
    //this function will get the text of the item and try to run it as a DisplayFusion function
    private static void MenuItem_Click(object sender, EventArgs e)
    {
        ToolStripItem item = sender as ToolStripItem;
        if (item == null)
            return;

        BFS.DisplayFusion.RunFunction(item.Text);
    }
}</pre><textarea id="code019e51b2ee197546b65e9e8e56b7e3d4" name="code019e51b2ee197546b65e9e8e56b7e3d4" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
<media:thumbnail url="https://www.displayfusion.com/Discussions/Download/?ID=019092e9-ce99-7291-8fcd-2a4d83a89811"/>
</item>
</channel>
</rss>