<?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 to bring a different window to the front</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=0193459f-cbd3-76c2-ac51-41a5846642f8" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=0193459f-cbd3-76c2-ac51-41a5846642f8</link>
<description>DisplayFusion RSS: Script to bring a different window to the front</description>
<lastBuildDate>Thu, 21 May 2026 15:06:10 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=0193459f-cbd3-76c2-ac51-41a5846642f8</generator>
<item>
<title>RE: Script to bring a different window to the front</title>
<link>https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#7</link>
<pubDate>Fri, 22 Nov 2024 13:37:13 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#7</guid>
<category>DisplayFusion</category>
<description><![CDATA[The restore function won't actually bring it to the front, you'll need to focus the window first. Try using this line instead:
Code
Copy
Select All
BFS.Window.Focus(windowHandle);
and then add another line to re-focus the main Autocad window after]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
The restore function won't actually bring it to the front, you'll need to focus the window first. Try using this line instead: <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="#code019e4b12995577189ef6d85ae02d2779" 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('code019e4b12995577189ef6d85ae02d2779Js'); 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="code019e4b12995577189ef6d85ae02d2779Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">BFS.Window.Focus(windowHandle);</pre><textarea id="code019e4b12995577189ef6d85ae02d2779" name="code019e4b12995577189ef6d85ae02d2779" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
and then add another line to re-focus the main Autocad window after
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Script to bring a different window to the front</title>
<link>https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#6</link>
<pubDate>Thu, 21 Nov 2024 17:33:54 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#6</guid>
<category>DisplayFusion</category>
<description><![CDATA[I changed the code a little to streamline, but it's still not working.
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...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I changed the code a little to streamline, but it's still not working.<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="#code019e4b12995e7318885e0289eec67440" 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('code019e4b12995e7318885e0289eec67440Js'); 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="code019e4b12995e7318885e0289eec67440Js" 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)
    {
        // Find the AutoCAD text window
        IntPtr windowhandle = BFS.Window.GetWindowByText("AutoCAD Text*");

        // Bring the AutoCAD text window to the front if AutoCAD has the focus
        BFS.Window.Minimize(windowHandle);
        BFS.Window.Restore(windowHandle);
    }
}</pre><textarea id="code019e4b12995e7318885e0289eec67440" name="code019e4b12995e7318885e0289eec67440" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Script to bring a different window to the front</title>
<link>https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#5</link>
<pubDate>Thu, 21 Nov 2024 17:32:49 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#5</guid>
<category>DisplayFusion</category>
<description><![CDATA[Neither of the functions are working.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Neither of the functions are working.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Script to bring a different window to the front</title>
<link>https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#4</link>
<pubDate>Thu, 21 Nov 2024 13:41:36 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Is that function currently pulling the text window to the front, or is that part failing as well?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Is that function currently pulling the text window to the front, or is that part failing as well?
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Script to bring a different window to the front</title>
<link>https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#3</link>
<pubDate>Wed, 20 Nov 2024 14:42:54 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Quote:
You want the text window brought to the front, but the main Auto Cad window to have focus?
Yep, exactly.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="BackGrey"><div class="Text"><div><b>Quote:</b></div>You want the text window brought to the front, but the main Auto Cad window to have focus?</div></div><br/>
<br/>
Yep, exactly.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Script to bring a different window to the front</title>
<link>https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#2</link>
<pubDate>Wed, 20 Nov 2024 13:25:58 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[You want the text window brought to the front, but the main Auto Cad window to have focus?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
You want the text window brought to the front, but the main Auto Cad window to have focus?
</div>
]]></content:encoded>
</item>
<item>
<title>Script to bring a different window to the front</title>
<link>https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8</link>
<pubDate>Tue, 19 Nov 2024 18:12:01 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-to-bring-a-different-window-to-the-front/?ID=0193459f-cbd3-76c2-ac51-41a5846642f8</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hi all,
I'm trying to use triggers and functions to bring the autocad text window to the front when the main AutoCAD window gets the focus. I have my text window on a second monitor that sometimes gets covered by PDF files or emails.
I have a trigger to run this function when the AutoCAD window...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hi all,<br/>
<br/>
I'm trying to use triggers and functions to bring the autocad text window to the front when the main AutoCAD window gets the focus. I have my text window on a second monitor that sometimes gets covered by PDF files or emails.<br/>
<br/>
I have a trigger to run this function when the AutoCAD window gets the focus. But I don't wnat the text window to keep the focus. It doesn't seem to be working and I can't figure out why. Any thoughts?<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="#code019e4b1299847735affdfa673ab01025" 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('code019e4b1299847735affdfa673ab01025Js'); 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="code019e4b1299847735affdfa673ab01025Js" 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)
    {
        // Find the AutoCAD text window
        IntPtr [] windowhandle = BFS.Window.GetWindowsByText("AutoCAD Text Window*");

        // Bring the AutoCAD text window to the front if AutoCAD has the focus
        bool ok1 = BFS.Window.Minimize(windowHandle);
        bool ok2 = BFS.Window.Restore(windowHandle);
    }
}</pre><textarea id="code019e4b1299847735affdfa673ab01025" name="code019e4b1299847735affdfa673ab01025" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>