Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TopWindow&PopUp, TrayIcon » How to remove the button [X] that closes the window?
Re: How to remove the button [X] that close the window [message #2853 is a reply to message #2852] Fri, 28 April 2006 10:25 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
See this post.

(Edit by fudadmin: url removed, topics merged.)

Disable the close button

EnableMenuItem( GetSystemMenu( hWnd, 0 ), SC_CLOSE, MF_BYCOMMAND
|MF_DISABLED );



Remove the close button (I think).

HMENU hMenu = GetSystemMenu( hWnd, 0 );
int nNbItems = GetMenuItemCount(hMenu);
RemoveMenu(hMenu, nNbItems - 1, MF_BYPOSITION);
RemoveMenu(hMenu, nNbItems - 2, MF_BYPOSITION);


And handle WM_SYSCOMMAND (SC_CLOSE) if you want also to disable [Alt]+[F4]

[Updated on: Fri, 28 April 2006 10:52] by Moderator

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How do I change main window and dialog title font size
Next Topic: TopWindow when Close override show exception unduly
Goto Forum:
  


Current Time: Sun Jun 15 23:50:34 CEST 2025

Total time taken to generate the page: 0.03866 seconds