U++ framework
Do not panic. Ask here before giving up.

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: Thu Sep 10 02:54:09 GMT+2 2026

Total time taken to generate the page: 0.00652 seconds