<?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: Disabling Windows Close Button</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=144aa2d3-c5f1-418b-8342-de833f50bd84" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=144aa2d3-c5f1-418b-8342-de833f50bd84</link>
<description>DisplayFusion RSS: Disabling Windows Close Button</description>
<lastBuildDate>Wed, 14 Oct 2026 00:00:07 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=144aa2d3-c5f1-418b-8342-de833f50bd84</generator>
<item>
<title>RE: Disabling Windows Close Button</title>
<link>https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84#5</link>
<pubDate>Mon, 09 Jul 2018 15:42:13 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84#5</guid>
<category>DisplayFusion</category>
<description><![CDATA[I think it's not always convenient to use triggers. And a little bit changed the script to use it with hot keys. Works as a switch, with a single hotkey.
Code
Copy
Select All
using System;&#xA;using System.Drawing;&#xA;using System.Runtime.InteropServices;&#xA;&#xA;public static class Display...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I think it's not always convenient to use triggers. And a little bit changed the script to use it with hot keys. Works as a switch, with a single hotkey.<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="#code01a137b58d87767a9f8ca3c688f48134" 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('code01a137b58d87767a9f8ca3c688f48134Js'); 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="code01a137b58d87767a9f8ca3c688f48134Js" name="code01a137b58d87767a9f8ca3c688f48134Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;using System.Runtime.InteropServices;&#xA;&#xA;public static class DisplayFusionFunction&#xA;{&#xA;    [DllImport(&quot;user32.dll&quot;)]&#xA;    private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);&#xA;    [DllImport(&quot;user32.dll&quot;)]&#xA;    private static extern int EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);&#xA;    &#xA;    private const uint CloseButton = 0xF060;&#xA;    private const uint Enabled = 0x00000000;&#xA;    private const uint Disabled = 0x00000002;&#xA;&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        if(!BFS.ScriptSettings.ReadValueBool(&quot;CloseButtonState&quot;))&#xA;        {&#xA;            EnableMenuItem(GetSystemMenu(windowHandle, false), CloseButton, Enabled);&#xA;            BFS.ScriptSettings.WriteValueBool(&quot;CloseButtonState&quot;, true);&#xA;        }&#xA;        else&#xA;        {&#xA;            EnableMenuItem(GetSystemMenu(windowHandle, false), CloseButton, Disabled);&#xA;            BFS.ScriptSettings.WriteValueBool(&quot;CloseButtonState&quot;, false);&#xA;        }&#xA;    }&#xA;}</pre><textarea id="code01a137b58d87767a9f8ca3c688f48134" name="code01a137b58d87767a9f8ca3c688f48134" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Disabling Windows Close Button</title>
<link>https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84#4</link>
<pubDate>Sat, 07 Jul 2018 16:54:50 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Quote:
Searching in Google and PInvoke.net i was able to find a simple solution. Create trigger on the desired application (window created, focus, or what else) and use the following script as an action. I hope from the code it is clear that you can both disable and enable the button, just comme...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="BackGrey"><div class="Text"><div><b>Quote:</b></div>Searching in Google and PInvoke.net i was able to find a simple solution. Create trigger on the desired application (window created, focus, or what else) and use the following script as an action. I hope from the code it is clear that you can both disable and enable the button, just commenting\uncommenting the desired line in the code.<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="#code01a137b58da37325b68f3e7ca0eefadb" 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('code01a137b58da37325b68f3e7ca0eefadbJs'); 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="code01a137b58da37325b68f3e7ca0eefadbJs" name="code01a137b58da37325b68f3e7ca0eefadbJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;using System.Runtime.InteropServices;&#xA;&#xA;public static class DisplayFusionFunction&#xA;{&#xA;    [DllImport(&quot;user32.dll&quot;)] private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);&#xA;    [DllImport(&quot;user32.dll&quot;)] private static extern int EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);&#xA;    &#xA;    private const uint Close = 0xF060;&#xA;    private const uint Enabled = 0x00000000;&#xA;    private const uint Disabled = 0x00000002;&#xA;&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        EnableMenuItem(GetSystemMenu(windowHandle, false), Close, Disabled);&#xA;        // EnableMenuItem(GetSystemMenu(windowHandle, false), Close, Enabled);&#xA;    }&#xA;}</pre><textarea id="code01a137b58da37325b68f3e7ca0eefadb" name="code01a137b58da37325b68f3e7ca0eefadb" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div></div></div><br/>
<br/>
Brilliant! Script works perfectly! Thanks!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Disabling Windows Close Button</title>
<link>https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84#3</link>
<pubDate>Sat, 07 Jul 2018 13:10:59 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Searching in Google and PInvoke.net i was able to find a simple solution. Create trigger on the desired application (window created, focus, or what else) and use the following script as an action. I hope from the code it is clear that you can both disable and enable the button, just commenting\un...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Searching in Google and PInvoke.net i was able to find a simple solution. Create trigger on the desired application (window created, focus, or what else) and use the following script as an action. I hope from the code it is clear that you can both disable and enable the button, just commenting\uncommenting the desired line in the code.<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="#code01a137b58dc7701eb5700060c194ade6" 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('code01a137b58dc7701eb5700060c194ade6Js'); 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="code01a137b58dc7701eb5700060c194ade6Js" name="code01a137b58dc7701eb5700060c194ade6Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;using System.Runtime.InteropServices;&#xA;&#xA;public static class DisplayFusionFunction&#xA;{&#xA;    [DllImport(&quot;user32.dll&quot;)] private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);&#xA;    [DllImport(&quot;user32.dll&quot;)] private static extern int EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);&#xA;    &#xA;    private const uint Close = 0xF060;&#xA;    private const uint Enabled = 0x00000000;&#xA;    private const uint Disabled = 0x00000002;&#xA;&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        EnableMenuItem(GetSystemMenu(windowHandle, false), Close, Disabled);&#xA;        // EnableMenuItem(GetSystemMenu(windowHandle, false), Close, Enabled);&#xA;    }&#xA;}</pre><textarea id="code01a137b58dc7701eb5700060c194ade6" name="code01a137b58dc7701eb5700060c194ade6" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Disabling Windows Close Button</title>
<link>https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84#2</link>
<pubDate>Fri, 06 Jul 2018 15:01:32 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[There is a terrific free little app that can do this for you called NoClose
Read More/Download Here:
http://www.dcmembers.com/skrommel/download/noclose/]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
There is a terrific free little app that can do this for you called NoClose<br/>
Read More/Download Here:<br/>
<a href="http://www.dcmembers.com/skrommel/download/noclose/" target="_blank" rel="nofollow"><b>http://www.dcmembers.com/skrommel/download/noclose/</b></a>
</div>
]]></content:encoded>
</item>
<item>
<title>Disabling Windows Close Button</title>
<link>https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84</link>
<pubDate>Thu, 05 Jul 2018 17:42:51 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/disabling-windows-close-button/?ID=144aa2d3-c5f1-418b-8342-de833f50bd84</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hello, just wondering if there was a way to disable the windows close button (X) in the upper right corner of a window similar to Actual Window Manager? Trying to find a way to prevent specific programs from accidentally closing. Thanks!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hello, just wondering if there was a way to disable the windows close button (X) in the upper right corner of a window similar to Actual Window Manager? Trying to find a way to prevent specific programs from accidentally closing. Thanks!
</div>
]]></content:encoded>
</item>
</channel>
</rss>