<?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: Center active window to a spesific dimension</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3</link>
<description>DisplayFusion RSS: Center active window to a spesific dimension</description>
<lastBuildDate>Fri, 22 May 2026 11:31:42 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3</generator>
<item>
<title>RE: Center active window to a spesific dimension</title>
<link>https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#6</link>
<pubDate>Tue, 25 Jun 2024 17:16:31 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#6</guid>
<category>DisplayFusion</category>
<description><![CDATA[I've attached a script below that should do this. You can import it via the DisplayFusion Settings  Functions  Scripted Function  Import Scripted Function.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I've attached a script below that should do this. You can import it via the DisplayFusion Settings > Functions > Scripted Function > Import Scripted Function.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Center active window to a spesific dimension</title>
<link>https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#5</link>
<pubDate>Mon, 17 Jun 2024 14:21:01 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#5</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hi. This worked, center window, se picture
Now I want to use the function :Center Window Ignoring Splits (run again to restore position)
using System;
using System.Drawing;
// Moves active window to center of monitor, ignoring splits
// when run again (for same window) restores original posi...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hi. This worked, center window, se picture<br/>
<br/>
Now I want to use the function :Center Window Ignoring Splits (run again to restore position)<br/>
using System;<br/>
using System.Drawing;<br/>
<br/>
// Moves active window to center of monitor, ignoring splits<br/>
// when run again (for same window) restores original position<br/>
// position is stored per window, so any number of windows may be centered and then moved back to original position<br/>
// set targetWidth to change window's width when centered (width is also restored when restoring position)<br/>
// ***<br/>
// TIP - set targetWidth to 1920 to emulate the width of a borderless FULL-HD window (very useful for ultra wides)<br/>
// ***<br/>
public static class DisplayFusionFunction<br/>
{<br/>
<br/>
In this function i wold like to take active window, center and fit 1560, 0,2000,1392<br/>
<br/>
WHen runn Center Window Ignoring Splits (run again to restore position) again then it goes back to previous size:<br/>
<br/>
Is that an option?
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Center active window to a spesific dimension</title>
<link>https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#4</link>
<pubDate>Thu, 08 Jun 2023 14:43:18 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[You can set the specified width/height in a custom function as well, but if you need it done via a scripted function, you can cut out the variables you're declaring inside the brackets. It should look like this:
Code
Copy
Select All
BFS.Window.SetSizeAndLocation(windowHandle, 1000, 0, 2000, 1...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
You can set the specified width/height in a custom function as well, but if you need it done via a scripted function, you can cut out the variables you're declaring inside the brackets. It should look like this:<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="#code019e4f749bcd7251a57bf1303b93c087" 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('code019e4f749bcd7251a57bf1303b93c087Js'); 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="code019e4f749bcd7251a57bf1303b93c087Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">BFS.Window.SetSizeAndLocation(windowHandle, 1000, 0, 2000, 1400);</pre><textarea id="code019e4f749bcd7251a57bf1303b93c087" name="code019e4f749bcd7251a57bf1303b93c087" 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: Center active window to a spesific dimension</title>
<link>https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#3</link>
<pubDate>Thu, 08 Jun 2023 06:33:23 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Quote:
You can use a custom function to do that, you can find our guide on custom functions here: https://www.displayfusion.com/HelpGuide/CustomFunctions/
Thanks, I have a running finction that place windows in center of screen, but I want it to have heigth = 1400, and width = 2000,  when I try...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="BackGrey"><div class="Text"><div><b>Quote:</b></div>You can use a custom function to do that, you can find our guide on custom functions here: <a href="https://www.displayfusion.com/HelpGuide/CustomFunctions/" target="_blank" rel="nofollow"><b>https://www.displayfusion.com/HelpGuide/CustomFunctions/</b></a></div></div><br/>
<br/>
Thanks, I have a running finction that place windows in center of screen, but I want it to have heigth = 1400, and width = 2000,  when I try this DP crashes:<br/>
<br/>
//SetSizeAndLocation(IntPtr windowHandle, int x, int y, int width, int height);<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="#code019e4f749bd774e6b37c7384cd4720cd" 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('code019e4f749bd774e6b37c7384cd4720cdJs'); 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="code019e4f749bd774e6b37c7384cd4720cdJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">SetSizeAndLocation(IntPtr windowHandle, int 1000, int 0, int 2000, int 1400);</pre><textarea id="code019e4f749bd774e6b37c7384cd4720cd" name="code019e4f749bd774e6b37c7384cd4720cd" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Center active window to a spesific dimension</title>
<link>https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#2</link>
<pubDate>Wed, 07 Jun 2023 13:49:41 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[You can use a custom function to do that, you can find our guide on custom functions here: https://www.displayfusion.com/HelpGuide/CustomFunctions/]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
You can use a custom function to do that, you can find our guide on custom functions here: <a href="https://www.displayfusion.com/HelpGuide/CustomFunctions/" target="_blank" rel="nofollow"><b>https://www.displayfusion.com/HelpGuide/CustomFunctions/</b></a>
</div>
]]></content:encoded>
</item>
<item>
<title>Center active window to a spesific dimension</title>
<link>https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3</link>
<pubDate>Wed, 07 Jun 2023 07:27:32 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/center-active-window-to-a-spesific-dimension/?ID=3784a147-829a-4bd0-b107-1e3ec1a4a1c3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hi
I need a script that expands and center active window
Heigth 1400
Width 1800
Screen is 5400 x 1400 pix
I explect that command
Code
Copy
Select All
SetSizeAndLocation(IntPtr windowHandle, int x, int y, int width, int height);
can be used, but when I tried DF crashed
Thanks up front!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hi<br/>
<br/>
I need a script that expands and center active window<br/>
<br/>
Heigth 1400<br/>
Width 1800<br/>
<br/>
Screen is 5400 x 1400 pix<br/>
<br/>
I explect that command <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="#code019e4f749be2721dada06b3dc193dfa4" 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('code019e4f749be2721dada06b3dc193dfa4Js'); 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="code019e4f749be2721dada06b3dc193dfa4Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">SetSizeAndLocation(IntPtr windowHandle, int x, int y, int width, int height);</pre><textarea id="code019e4f749be2721dada06b3dc193dfa4" name="code019e4f749be2721dada06b3dc193dfa4" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
can be used, but when I tried DF crashed<br/>
<br/>
Thanks up front!
</div>
]]></content:encoded>
</item>
</channel>
</rss>