<?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: Scripted Function move and resize</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=f57dc471-b5ab-4b2b-ab89-986a50684d0f" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=f57dc471-b5ab-4b2b-ab89-986a50684d0f</link>
<description>DisplayFusion RSS: Scripted Function move and resize</description>
<lastBuildDate>Thu, 16 Apr 2026 21:57:00 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=f57dc471-b5ab-4b2b-ab89-986a50684d0f</generator>
<item>
<title>RE: Scripted Function move and resize</title>
<link>https://www.displayfusion.com/Discussions/View/scripted-function-move-and-resize/?ID=f57dc471-b5ab-4b2b-ab89-986a50684d0f#4</link>
<pubDate>Wed, 11 May 2022 17:40:28 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/scripted-function-move-and-resize/?ID=f57dc471-b5ab-4b2b-ab89-986a50684d0f#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Could you send me a copy of your troubleshooting info? Here are the steps:
Open the Settings  Troubleshooting tab
Click the "Export Info to File" button
Reply with the file attached
Thanks!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Could you send me a copy of your troubleshooting info? Here are the steps:<br/>
<ul class="ListBullet">
<li>Open the Settings > Troubleshooting tab</li>
<li>Click the "Export Info to File" button</li>
<li>Reply with the file attached</li></ul>
<br/>
Thanks!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Scripted Function move and resize</title>
<link>https://www.displayfusion.com/Discussions/View/scripted-function-move-and-resize/?ID=f57dc471-b5ab-4b2b-ab89-986a50684d0f#3</link>
<pubDate>Wed, 11 May 2022 15:52:40 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/scripted-function-move-and-resize/?ID=f57dc471-b5ab-4b2b-ab89-986a50684d0f#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Code
Copy
Select All
using System;
using System.Drawing;
// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<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="#code019d984c26be771d80715f892577da57" 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('code019d984c26be771d80715f892577da57Js'); 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="code019d984c26be771d80715f892577da57Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger 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)
    {
        if (BFS.DisplayFusion.GetCurrentMonitorProfile() == "Home"){

            //BFS.Window.MoveToMonitor(1, windowHandle);
            BFS.Window.SetSizeAndLocation(windowHandle, 0,0,1720,1400);
            
        }
        
        else if(BFS.DisplayFusion.GetCurrentMonitorProfile() == "Office"){
            BFS.Window.MoveToMonitorMaximized(3, windowHandle);
        }
    }
}</pre><textarea id="code019d984c26be771d80715f892577da57" name="code019d984c26be771d80715f892577da57" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
The problem I have is in the if statement if the profile is "Home". This function currently just moves my window to the left and sets my desired size, but it doesn't move monitor. What I would like to happen is, move to monitor 1, you can see the commented line in the code, and then set size and location. But as soon as I remove the comment the set size and location stops working. It only takes the first line.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Scripted Function move and resize</title>
<link>https://www.displayfusion.com/Discussions/View/scripted-function-move-and-resize/?ID=f57dc471-b5ab-4b2b-ab89-986a50684d0f#2</link>
<pubDate>Wed, 11 May 2022 14:21:45 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/scripted-function-move-and-resize/?ID=f57dc471-b5ab-4b2b-ab89-986a50684d0f#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hi Felix,
Could you send me over the script you're working with?
Thanks!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hi Felix,<br/>
<br/>
Could you send me over the script you're working with?<br/>
<br/>
Thanks!
</div>
]]></content:encoded>
</item>
<item>
<title>Scripted Function move and resize</title>
<link>https://www.displayfusion.com/Discussions/View/scripted-function-move-and-resize/?ID=f57dc471-b5ab-4b2b-ab89-986a50684d0f</link>
<pubDate>Wed, 11 May 2022 10:02:58 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/scripted-function-move-and-resize/?ID=f57dc471-b5ab-4b2b-ab89-986a50684d0f</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hi!
I'm trying to write a scripted function that moves a window to a specific monitor and resizes it. Why I need it as a scripted function and not as a normal one is because I need an if statement that checks what profile I'm running. I can't get it to work however. I have tried with MoveToMonit...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hi!<br/>
I'm trying to write a scripted function that moves a window to a specific monitor and resizes it. Why I need it as a scripted function and not as a normal one is because I need an if statement that checks what profile I'm running. I can't get it to work however. I have tried with MoveToMonitor (works) and then SetSizeAndLocation (doesnt work).<br/>
I have also tried the MoveToMonitorResized function which should be the obvious choice I think but I don't understand the parameters that function should take. Any help is appreciated.
</div>
]]></content:encoded>
</item>
</channel>
</rss>