<?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: Script Help - Multiple If dependencies possible?  'if (a &amp; b &amp; c) = true'</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0</link>
<description>DisplayFusion RSS: Script Help - Multiple If dependencies possible?  'if (a &amp; b &amp; c) = true'</description>
<lastBuildDate>Sun, 19 Apr 2026 17:52:23 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0</generator>
<item>
<title>RE: Script Help - Multiple If dependencies possible?  'if (a &amp; b &amp; c) = true'</title>
<link>https://www.displayfusion.com/Discussions/View/script-help-multiple-if-dependencies-possible-if-a-b-c-true/?ID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0#3</link>
<pubDate>Tue, 20 Oct 2020 23:58:00 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-help-multiple-if-dependencies-possible-if-a-b-c-true/?ID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[This worked perfectly! thank you so much for the help.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
This worked perfectly! thank you so much for the help.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Script Help - Multiple If dependencies possible?  'if (a &amp; b &amp; c) = true'</title>
<link>https://www.displayfusion.com/Discussions/View/script-help-multiple-if-dependencies-possible-if-a-b-c-true/?ID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0#2</link>
<pubDate>Tue, 20 Oct 2020 21:32:13 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-help-multiple-if-dependencies-possible-if-a-b-c-true/?ID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[If you get the bounds of the window, you can check them in the if statement like this:
Code
Copy
Select All
Rectangle windowBounds = BFS.Window.GetBounds(window);
if (currentMonitor == 4 &&
windowBounds.X == 123 &&
windowBounds.Y == 456 &&
windowBounds.Width == 800 &&
windowBounds.Height...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
If you get the bounds of the window, you can check them in the if statement like this:<br/>
<br/>
<div id="" 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="#code019da6df4696758ca5ebb452e080fe03" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da6df4696758ca5ebb452e080fe03Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da6df4696758ca5ebb452e080fe03Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">Rectangle windowBounds = BFS.Window.GetBounds(window);
if (currentMonitor == 4 &&
    windowBounds.X == 123 &&
    windowBounds.Y == 456 &&
    windowBounds.Width == 800 &&
    windowBounds.Height == 600)
{
    // Do stuff
}</pre><textarea id="code019da6df4696758ca5ebb452e080fe03" name="code019da6df4696758ca5ebb452e080fe03" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
Alternatively, to make the if statement a bit cleaner, you can set the bounds you want to check in a Rect first, like this:<br/>
<br/>
<div id="" 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="#code019da6df4698774fa836388085aa8530" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da6df4698774fa836388085aa8530Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da6df4698774fa836388085aa8530Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">Rectangle windowBounds = BFS.Window.GetBounds(windowHandle);
Rectangle compareBounds = new Rectangle(123,456,800,600);
if (currentMonitor == 4 && windowBounds == compareBounds)
{
    // Do stuff
}</pre><textarea id="code019da6df4698774fa836388085aa8530" name="code019da6df4698774fa836388085aa8530" 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>Script Help - Multiple If dependencies possible?  'if (a &amp; b &amp; c) = true'</title>
<link>https://www.displayfusion.com/Discussions/View/script-help-multiple-if-dependencies-possible-if-a-b-c-true/?ID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0</link>
<pubDate>Mon, 19 Oct 2020 02:27:56 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-help-multiple-if-dependencies-possible-if-a-b-c-true/?ID=5bc9eac4-a8a6-4fc7-9a49-0ce23525e4e0</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hello again!
I was wondering when creating 'if commands', is it possible to include another dependency on top of the initial one, so here is a current script that I have (linked below), and I want to include a dependency based on the location of another window entirely, and then reference it int...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hello again!<br/>
<br/>
I was wondering when creating 'if commands', is it possible to include another dependency on top of the initial one, so here is a current script that I have (linked below), and I want to include a dependency based on the location of another window entirely, and then reference it into the if command. so I imagine i'd first have to specify the window i am talking about with something like this:<br/>
<br/>
        IntPtr window = BFS.Window.GetWindowByText("*Program Name*");<br/>
<br/>
but then how do i tell the function, to also include the coordinates of this window?<br/>
<br/>
if (currentMonitor == 4) && location of program listed above is at a specific location (Rectangle (x, y, h, w);<br/>
<br/>
then continue with the specified task<br/>
<br/>
is this possible in anyway?<br/>
<br/>
______________________________________<br/>
<br/>
<div id="" 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="#code019da6df469e7205813a276604c33ca3" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da6df469e7205813a276604c33ca3Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da6df469e7205813a276604c33ca3Js" 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)
    {
        // (Google Chrome tab dragging fix)
        if(BFS.Input.IsMouseDown("1"))
            return;
        
        // Get the monitor that the mouse cursor is on
        uint currentMonitor = BFS.Monitor.GetMonitorIDByXY(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY());
        
        // Setup the locations for the left and right monitors
        Rectangle topMonitorLocation = new Rectangle(-554, -1034, 1523, 1028);
        Rectangle toptopMonitorLocation = new Rectangle(-240, -2240, 1920, 1160);
        
        // Move window on which monitor the mouse cursor is on
        if (currentMonitor == 4)
        {
            BFS.Window.SetSizeAndLocation(windowHandle, topMonitorLocation.X, topMonitorLocation.Y, topMonitorLocation.Width, topMonitorLocation.Height);
        }
        else if (currentMonitor == 5)
        {
            BFS.Window.SetSizeAndLocation(windowHandle, toptopMonitorLocation.X, toptopMonitorLocation.Y, toptopMonitorLocation.Width, toptopMonitorLocation.Height);
        }
    }
}</pre><textarea id="code019da6df469e7205813a276604c33ca3" name="code019da6df469e7205813a276604c33ca3" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>