How can I remove the Close button from my window caption?
Permanent link:
cppdashboard.dev/r/2026/09/how-can-i-remove-the-close-button-from-my-window-caption-2This article discusses methods to remove the Close button from a window caption in a Windows application. It explains the implications of removing the System menu and provides code snippets to disable the Close button while retaining Minimize and Maximize options.
From the article
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.
Share this resource