The article explains how to remove or disable the Close button in Windows application windows, discussing different methods and their implications for developers.
<p>Occasionally, somebody wants to create a window without a Close button.</p>
<p>The only way to get rid of the Close button is not to have a System menu at all: Remove the <code>WS_<wbr />SYSMENU</code> style from the window. But that also gets rid of the Minimize and Maximize buttons, so it’s kind of drastic.</p>
<p>If you want a System menu, or if you want Minimize and Maximize buttons, you can at least disable the Close button by disabling the <code>SC_CLOSE</code> menu item.</p>
<pre>HMENU menu = GetSystemMenu(hwnd, FALSE);
EnableMenuItem(menu, SC_CLOSE, MF_DISABLED);
</pre>
<p>Of course, you could use the nuclear option and implement your own custom title bar. Then you can do whatever you want. But most people are probably not willing to take things to such an extreme.</p>
<p>But really, try not to hide or disable the Close the button at all. End users don’t like it. It makes them feel trapped.</p>
<p>The post <a href="https://devblogs.microsoft.com/oldnewthing/20260911-00/?p=112691">How can I remove the Close button from my window caption?</a> appeared first on <a href="https://devblogs.microsoft.com/oldnewthing">The Old New Thing</a>.</p>
# How can I remove the Close button from my window caption? - The Old New Thing
Source: [https://devblogs.microsoft.com/oldnewthing/20260911-00?p=112691](https://devblogs.microsoft.com/oldnewthing/20260911-00?p=112691)
September 11th, 2026
0 reactions

Occasionally, somebody wants to create a window without a Close button\.
The only way to get rid of the Close button is not to have a System menu at all: Remove the`WS\_SYSMENU`style from the window\. But that also gets rid of the Minimize and Maximize buttons, so it’s kind of drastic\.
If you want a System menu, or if you want Minimize and Maximize buttons, you can at least disable the Close button by disabling the`SC\_CLOSE`menu item\.
```
HMENU menu = GetSystemMenu(hwnd, FALSE);
EnableMenuItem(menu, SC_CLOSE, MF_DISABLED);
```
Of course, you could use the nuclear option and implement your own custom title bar\. Then you can do whatever you want\. But most people are probably not willing to take things to such an extreme\.
But really, try not to hide or disable the Close the button at all\. End users don’t like it\. It makes them feel trapped\.
### Category
## Author

Raymond has been involved in the evolution of Windows for more than 30 years\. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie\-jeebies\. The Web site spawned a book, coincidentally also titled The Old New Thing \(Addison Wesley 2007\)\. He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information\.
## Read next
## Stay informed
Get notified when new posts are published\.
Follow this blog
- [https://twitter.com/ChenCravat](https://twitter.com/ChenCravat)
- [](https://www.youtube.com/playlist?list=PLlrxD0HtieHge3_8Dm48C0Ns61I6bHThc)
- [https://github.com/oldnewthing](https://github.com/oldnewthing)
- [https://devblogs.microsoft.com/oldnewthing/feed/](https://devblogs.microsoft.com/oldnewthing/feed/)
A Windows developer asks how to exclude the cursor from a region, the opposite of ClipCursor. The article explains a technique to avoid flicker by not moving the cursor but instead snapping the object's position to the nearest legal location.
Captain Kill Switch is a free, private, and cross-platform tool that allows users to close all open apps with a single click from the menu bar for macOS, Windows, and Linux.
Microsoft is rolling out an update that lets Office users remove the floating Copilot button in Word, Excel, and PowerPoint, addressing user complaints about it obstructing cells and documents.
Explains that FILE_FLAG_DELETE_ON_CLOSE is irreversible, but you can achieve conditional deletion by using SetFileInformationByHandle to toggle the delete disposition.
This article explains that Windows does not have a built-in concept of binary vs. text mode at the OS level; such distinctions are handled by runtime libraries like the C runtime. It clarifies that all files are treated as bytes by Windows and that content transformations must be done manually or via libraries.