<?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: Function with dependency based on monitor profile</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=66ebc82c-18d7-4165-9d05-3f8fc2497a74" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=66ebc82c-18d7-4165-9d05-3f8fc2497a74</link>
<description>DisplayFusion RSS: Function with dependency based on monitor profile</description>
<lastBuildDate>Sat, 20 Jun 2026 04:30:37 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=66ebc82c-18d7-4165-9d05-3f8fc2497a74</generator>
<item>
<title>RE: Function with dependency based on monitor profile</title>
<link>https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#6</link>
<pubDate>Thu, 08 Oct 2020 17:39:54 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#6</guid>
<category>DisplayFusion</category>
<description><![CDATA[Ah yep! I made a rookie mistake! I've updated my post with that change as well. Glad to hear it worked]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ah yep! I made a rookie mistake! I've updated my post with that change as well. Glad to hear it worked <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" />
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Function with dependency based on monitor profile</title>
<link>https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#5</link>
<pubDate>Thu, 08 Oct 2020 16:56:08 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#5</guid>
<category>DisplayFusion</category>
<description><![CDATA[turns out it needed 2 equal signs like this to work, "(currentMonitorProfile == "1920")".
thank again! works great.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
turns out it needed 2 equal signs like this to work, "(currentMonitorProfile == "1920")".<br/>
<br/>
thank again! works great.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Function with dependency based on monitor profile</title>
<link>https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#4</link>
<pubDate>Thu, 08 Oct 2020 15:55:01 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hello Keith, thank you for the reply, I just tried the code, and I get an error when trying to specify the current monitor profile, "Cannot implicitly convert type 'string' to 'bool'", any idea on how to fix this possibly? thanks again tremendously.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hello Keith, thank you for the reply, I just tried the code, and I get an error when trying to specify the current monitor profile, "Cannot implicitly convert type 'string' to 'bool'", any idea on how to fix this possibly? thanks again tremendously.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Function with dependency based on monitor profile</title>
<link>https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#3</link>
<pubDate>Thu, 08 Oct 2020 15:23:25 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[You can do this with a Scripted Function. Here's some sample code to get you started:
Code
Copy
Select All
using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Get the current monitor profile
string currentMoni...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
You can do this with a Scripted Function. Here's some sample code to get you started:<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="#code019ee34b82d77193a1ce4cacc4534c2a" 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('code019ee34b82d77193a1ce4cacc4534c2aJs'); 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="code019ee34b82d77193a1ce4cacc4534c2aJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        // Get the current monitor profile
        string currentMonitorProfile = BFS.DisplayFusion.GetCurrentMonitorProfile();
        
        if (currentMonitorProfile == "monitor profile 1")
        {
            BFS.DisplayFusion.LoadWindowPositionProfile("window position profile 1");
            BFS.DisplayFusion.RunFunction("custom function 1");
        }
        else if (currentMonitorProfile == "monitor profile 2")
        {
            BFS.DisplayFusion.LoadWindowPositionProfile("window position profile 2");
            BFS.DisplayFusion.RunFunction("custom function 1");
        }
        else if (currentMonitorProfile == "monitor profile 3")
        {
            BFS.DisplayFusion.LoadWindowPositionProfile("window position profile 3");
            BFS.DisplayFusion.RunFunction("custom function 1");
        }
    }
}</pre><textarea id="code019ee34b82d77193a1ce4cacc4534c2a" name="code019ee34b82d77193a1ce4cacc4534c2a" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
Hope that helps!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Function with dependency based on monitor profile</title>
<link>https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#2</link>
<pubDate>Thu, 08 Oct 2020 00:43:45 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[or instead of having it based off of current monitor profile, does anyone know of a way to reference the primary display/monitor resolution somehow? so if primary display resolution = "1920x1080" do 'x' function, or if primary display resolution = "1440x1080" do 'y' function]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
or instead of having it based off of current monitor profile, does anyone know of a way to reference the primary display/monitor resolution somehow? so if primary display resolution = "1920x1080" do 'x' function, or if primary display resolution = "1440x1080" do 'y' function
</div>
]]></content:encoded>
</item>
<item>
<title>Function with dependency based on monitor profile</title>
<link>https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74</link>
<pubDate>Tue, 06 Oct 2020 23:11:24 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/function-with-dependency-based-on-monitor-profile/?ID=66ebc82c-18d7-4165-9d05-3f8fc2497a74</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hey there, I was wondering if anyone knew of a way to create a function that basically when executed acts as: if monitor profile 1 = true, then do ‘x’ action, if monitor profile 2 = true, then do ‘y’ action, if monitor profile 3 = true, then do ‘z’ action’. Basically, one function that depending ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hey there, I was wondering if anyone knew of a way to create a function that basically when executed acts as: if monitor profile 1 = true, then do ‘x’ action, if monitor profile 2 = true, then do ‘y’ action, if monitor profile 3 = true, then do ‘z’ action’. Basically, one function that depending on which monitor profile I am in, executes a certain command. For example, if current monitor profile = ‘1920’ then execute windows position profile entitled ‘1920x’, or if current monitor profile = ‘5760’ then with the same function, execute windows position profile entitled ‘5760’. Also is there any way to run another function, through this? For example, if current monitor profile = ‘1920’, then run “abc” custom function, or if current monitor profile = ‘5760’, then run ‘def’ custom function. Any input regarding this would be much appreciated, just thought of this as a way to cut down on hotkeys, instead of having like 3 or 4 depending on which monitor profile I am currently in, if it were possible to consolidate it all into one function with one hotkey that acts accordingly depending on which profile I am currently in.
</div>
]]></content:encoded>
</item>
</channel>
</rss>