<?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: Move window to right third of screen?  (Minor function help needed)</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1</link>
<description>DisplayFusion RSS: Move window to right third of screen?  (Minor function help needed)</description>
<lastBuildDate>Sun, 19 Apr 2026 12:03:26 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1</generator>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#10</link>
<pubDate>Tue, 18 Dec 2018 19:08:55 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#10</guid>
<category>DisplayFusion</category>
<description><![CDATA[Make sure to backup your settings (Settings  Options  Export) when you're done, just so you don't lose all of that work!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Make sure to backup your settings (Settings > Options > Export) when you're done, just so you don't lose all of that work!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#9</link>
<pubDate>Tue, 18 Dec 2018 19:08:25 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#9</guid>
<category>DisplayFusion</category>
<description><![CDATA[Excellent, glad to hear it!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Excellent, glad to hear it!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#8</link>
<pubDate>Tue, 18 Dec 2018 16:50:41 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#8</guid>
<category>DisplayFusion</category>
<description><![CDATA[Just wanted to say thanks again.  I think I've settled on 7 buttons-  Left 33%, 50%, 66%, Right 33%, 50%, 66%, and "Portrait Squeeze" that sizes the window perfectly on my portait monitor without overlapping my Rainmeter skins.
I've still got a lot to tweak, but I'm making steady progress.  WIP ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Just wanted to say thanks again.  I think I've settled on 7 buttons-  Left 33%, 50%, 66%, Right 33%, 50%, 66%, and "Portrait Squeeze" that sizes the window perfectly on my portait monitor without overlapping my Rainmeter skins.   <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=":)" HelpButtonDataAlign="BelowMiddle" /> <br/>
<br/>
I've still got a lot to tweak, but I'm making steady progress.  WIP screenshot just for kicks <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=":)" HelpButtonDataAlign="BelowMiddle" />
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#7</link>
<pubDate>Mon, 10 Dec 2018 19:45:53 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#7</guid>
<category>DisplayFusion</category>
<description><![CDATA[Ok, try this out:
Code
Copy
Select All
using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Set the window width percentage here
double windowWidthPercent = 0.33;
// Get the monitor bounds
Rectangle monitorBo...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ok, try this out:<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="#code019da59fcaff77a8ac9a89b5fb2358ec" 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('code019da59fcaff77a8ac9a89b5fb2358ecJs'); 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="code019da59fcaff77a8ac9a89b5fb2358ecJs" 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)
    {
        // Set the window width percentage here
        double windowWidthPercent = 0.33;
        
        // Get the monitor bounds
        Rectangle monitorBounds = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle);
        
        // Create the target window bounds
        Rectangle targetWindowBounds = new Rectangle();
        
        // Set the target window width to the screen width * the windowWidthPercent
        targetWindowBounds.Width = Convert.ToInt32(monitorBounds.Width * windowWidthPercent);
        
        // Set the target window height to 100% of the screen height
        targetWindowBounds.Height = monitorBounds.Height;
        
        // Set the target X value to monitor X + monitor width - window width
        targetWindowBounds.X = (monitorBounds.X + monitorBounds.Width) - targetWindowBounds.Width;
        
        // Set the target Y value to the top of the monitor
        targetWindowBounds.Y = monitorBounds.Y;
        
        // Resize and move the window
        BFS.Window.SetSizeAndLocation(windowHandle, targetWindowBounds.X,  targetWindowBounds.Y, targetWindowBounds.Width, targetWindowBounds.Height);
    }
}</pre><textarea id="code019da59fcaff77a8ac9a89b5fb2358ec" name="code019da59fcaff77a8ac9a89b5fb2358ec" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
The left side is much easier, you just need to change the calculation to:<br/>
<br/>
targetWindowBounds.X = monitorBounds.X;<br/>
<br/>
And if you want to do the middle, do this:<br/>
<br/>
targetWindowBounds.X = monitorBounds.X + targetWindowBounds.Width;<br/>
<br/>
Hope that helps!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#6</link>
<pubDate>Sat, 08 Dec 2018 01:45:59 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#6</guid>
<category>DisplayFusion</category>
<description><![CDATA[Ok, thanks for the reply.
I can make my request much simpler.  I would be very happy to have a button that performs only one function:  Size the window to 33% width and move it to the Right side of the screen.
Using the code that you will hopefully graciously give me, I should be able to make m...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ok, thanks for the reply.<br/>
<br/>
I can make my request much simpler.  I would be very happy to have a button that performs only one function:  Size the window to 33% width and move it to the Right side of the screen.<br/>
<br/>
Using the code that you will hopefully graciously give me, I should be able to make my own button that does the exact same thing; only one function (no cycling) that will size to 33% and move to the Left side.<br/>
<br/>
Thank you much!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#5</link>
<pubDate>Fri, 30 Nov 2018 19:42:47 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#5</guid>
<category>DisplayFusion</category>
<description><![CDATA[The 33% is determined on line 25 by dividing the monitor width by 3:
int iFinalWinW = monitorRect.Width / 3;
The windowRect near the top is what gets the current window size, and further down it gets compared to the target size determined by iFinalWinX/Y/W/H.
The script you want to write would...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
The 33% is determined on line 25 by dividing the monitor width by 3:<br/>
<br/>
int iFinalWinW = monitorRect.Width / 3;<br/>
<br/>
The windowRect near the top is what gets the current window size, and further down it gets compared to the target size determined by iFinalWinX/Y/W/H.<br/>
<br/>
The script you want to write would be pretty complicated, but is possible to do. Basically, you'd need to know your desired size/locations, then compare the current size to figure out if it's already at one of them and load the next size. In reality, that's trickier than it sounds <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=":)" HelpButtonDataAlign="BelowMiddle" />
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#4</link>
<pubDate>Fri, 30 Nov 2018 17:28:56 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Ideally, I would like to understand the code better so that I can tweak things to my liking.
In the code snippet I pasted, could you (or someone) add comments to explain where the 33% width is determined, where the location of the window is determined, and how the cycling works between three loc...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ideally, I would like to understand the code better so that I can tweak things to my liking.  <br/>
<br/>
In the code snippet I pasted, could you (or someone) add comments to explain where the 33% width is determined, where the location of the window is determined, and how the cycling works between three locations?  <br/>
<br/>
In the end, I'll want a single button that cycles between these 3 functions: Size to 33% Width and Center Horizontally on Monitor (this is included in the code snippet, when the button is clicked twice), Size and Move Window to Top of Monitor, and Size and Move to Bottom (these two are built-in).<br/>
<br/>
I will also want a button that cycles between these 2 functions:  Size and Move Window (50%) to Left Side of Monitor, and Size and Move Window (33%) to Left Side of Monitor (again, this is included in the code snippet, when the button is clicked once).  <br/>
<br/>
Finally, I want a button that is the inverse of the one mentioned above - focusing on the right side instead of the left.<br/>
<br/>
Thanks very much!  <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=":)" HelpButtonDataAlign="BelowMiddle" /><br/>
<br/>
(EDIT:  Reworded description of first button to properly represent the order in which I want to click it - first Center, then Top, then Bottom.)
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#3</link>
<pubDate>Fri, 30 Nov 2018 15:12:57 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Were you able to get the separate buttons working with the Custom Functions you were mentioning in the other thread?
For the other script are you wanting it to cycle between 50% height, 100% width on the top, and the same on the bottom?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Were you able to get the separate buttons working with the Custom Functions you were mentioning in the other thread?<br/>
<br/>
For the other script are you wanting it to cycle between 50% height, 100% width on the top, and the same on the bottom?
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#2</link>
<pubDate>Thu, 29 Nov 2018 23:28:49 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[P.S. I almost forgot, I would also love a cycle-type button, similar to the one I posted above, that resizes to 50% vertical and moves to the top, then moves to the bottom when clicked again, etc.  Once I understand the code above a bit better, I should be able to do this on my own, unless you fe...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
P.S. I almost forgot, I would also love a cycle-type button, similar to the one I posted above, that resizes to 50% vertical and moves to the top, then moves to the bottom when clicked again, etc.  Once I understand the code above a bit better, I should be able to do this on my own, unless you feel so inclined to help further.  <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=":)" HelpButtonDataAlign="BelowMiddle" />  Thanks.
</div>
]]></content:encoded>
</item>
<item>
<title>Move window to right third of screen?  (Minor function help needed)</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1</link>
<pubDate>Thu, 29 Nov 2018 23:22:46 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-to-right-third-of-screen-minor-function-help-needed/?ID=13db7d7b-6bee-4e2a-a168-2efe2d3b5ad1</guid>
<category>DisplayFusion</category>
<description><![CDATA[This code contains what I need, but I'm not sure how to modify it to suit my needs.  It cycles between resizing and moving the active window to the left third, middle third, and right third.
I want separate buttons for middle third and right third.  I have left third already.
Code
Copy
Select...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
This code contains what I need, but I'm not sure how to modify it to suit my needs.  It cycles between resizing and moving the active window to the left third, middle third, and right third.<br/>
<br/>
I want separate buttons for middle third and right third.  I have left third already.<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="#code019da59fcb23718a851202ebcdb6ea3d" 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('code019da59fcb23718a851202ebcdb6ea3dJs'); 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="code019da59fcb23718a851202ebcdb6ea3dJs" 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
// - 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)
           {          
                     //check to see if there was an error, if there was, exit function
                     if (windowHandle == IntPtr.Zero)
                                return; 

                     //get the position of the window in the monitor, and the current monitor
                     Rectangle windowRect = BFS.Window.GetBounds(windowHandle);
                     Rectangle monitorRect = BFS.Monitor.GetMonitorWorkAreaByWindow(windowHandle);                     

                     int iFinalWinX = monitorRect.X;
                     int iFinalWinY = monitorRect.Y;
                     int iFinalWinW = monitorRect.Width / 3;
                     int iFinalWinH = monitorRect.Height; 

                     if(        windowRect.X == iFinalWinX  
                     /*        && windowRect.Y == iFinalWinY
                                &&      windowRect.Width == iFinalWinW
                                &&      windowRect.Height == iFinalWinH )                  {
                                iFinalWinX = monitorRect.X + iFinalWinW;  
                     } else if (windowRect.X == iFinalWinX + iFinalWinW) */
                     { iFinalWinX = monitorRect.X + 2*iFinalWinW;
                     } else if (windowRect.X == iFinalWinX + 2*iFinalWinW) {
                                iFinalWinX = monitorRect.X;
                     }                                

                     BFS.Window.SetSizeAndLocation(windowHandle, iFinalWinX, iFinalWinY, iFinalWinW, iFinalWinH );
           }
}</pre><textarea id="code019da59fcb23718a851202ebcdb6ea3d" name="code019da59fcb23718a851202ebcdb6ea3d" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>