How can I remove the Close button from my window caption?

The Old New Thing (Raymond Chen) News

Summary

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 />SYS­MENU</code> style from the window. But that also gets rid of the Minimize and Maximize buttons, so it&#8217;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&#8217;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>
Original Article
View Cached Full Text

Cached at: 09/14/26, 02:16 PM

# 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 ![](https://devblogs.microsoft.com/oldnewthing/wp-content/uploads/sites/38/2019/02/RaymondChen_5in-150x150.jpg) 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\_SYS­MENU`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 Chen](https://devblogs.microsoft.com/oldnewthing/wp-content/uploads/sites/38/2019/02/RaymondChen_5in-150x150.jpg) 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) - [![youtube](https://devblogs.microsoft.com/oldnewthing/wp-content/themes/devblogs-evo/images/social-icons/youtube.svg)](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/)

Similar Articles

Captain Kill Switch

Product Hunt

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.

How do I inform Windows that I’m writing a binary file?

The Old New Thing (Raymond Chen)

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.