<?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>Sun, 19 Apr 2026 09:11:12 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;
using System.Drawing;
using System.Runtime.InteropServices;
public static class DisplayFusionFunction...]]></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 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="#code019da5021f3675bc96d310c817e9a16b" 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('code019da5021f3675bc96d310c817e9a16bJs'); 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="code019da5021f3675bc96d310c817e9a16bJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;
using System.Runtime.InteropServices;

public static class DisplayFusionFunction
{
    [DllImport("user32.dll")]
    private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
    [DllImport("user32.dll")]
    private static extern int EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);
    
    private const uint CloseButton = 0xF060;
    private const uint Enabled = 0x00000000;
    private const uint Disabled = 0x00000002;

    public static void Run(IntPtr windowHandle)
    {
        if(!BFS.ScriptSettings.ReadValueBool("CloseButtonState"))
        {
            EnableMenuItem(GetSystemMenu(windowHandle, false), CloseButton, Enabled);
            BFS.ScriptSettings.WriteValueBool("CloseButtonState", true);
        }
        else
        {
            EnableMenuItem(GetSystemMenu(windowHandle, false), CloseButton, Disabled);
            BFS.ScriptSettings.WriteValueBool("CloseButtonState", false);
        }
    }
}</pre><textarea id="code019da5021f3675bc96d310c817e9a16b" name="code019da5021f3675bc96d310c817e9a16b" 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 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="#code019da5021f407483aed4c8fd054c7aad" 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('code019da5021f407483aed4c8fd054c7aadJs'); 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="code019da5021f407483aed4c8fd054c7aadJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;
using System.Runtime.InteropServices;

public static class DisplayFusionFunction
{
    [DllImport("user32.dll")] private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
    [DllImport("user32.dll")] private static extern int EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);
    
    private const uint Close = 0xF060;
    private const uint Enabled = 0x00000000;
    private const uint Disabled = 0x00000002;

    public static void Run(IntPtr windowHandle)
    {
        EnableMenuItem(GetSystemMenu(windowHandle, false), Close, Disabled);
        // EnableMenuItem(GetSystemMenu(windowHandle, false), Close, Enabled);
    }
}</pre><textarea id="code019da5021f407483aed4c8fd054c7aad" name="code019da5021f407483aed4c8fd054c7aad" 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 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="#code019da5021f4d74f0b1c4c4d0e285ce87" 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('code019da5021f4d74f0b1c4c4d0e285ce87Js'); 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="code019da5021f4d74f0b1c4c4d0e285ce87Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;
using System.Runtime.InteropServices;

public static class DisplayFusionFunction
{
    [DllImport("user32.dll")] private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
    [DllImport("user32.dll")] private static extern int EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);
    
    private const uint Close = 0xF060;
    private const uint Enabled = 0x00000000;
    private const uint Disabled = 0x00000002;

    public static void Run(IntPtr windowHandle)
    {
        EnableMenuItem(GetSystemMenu(windowHandle, false), Close, Disabled);
        // EnableMenuItem(GetSystemMenu(windowHandle, false), Close, Enabled);
    }
}</pre><textarea id="code019da5021f4d74f0b1c4c4d0e285ce87" name="code019da5021f4d74f0b1c4c4d0e285ce87" 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>