Home
Tutorials
Code Snippets
Code Samples
Downloads
Links

The Blog
Our Projects
About
Contact

::Add RageStorm to Favorites!::

The Blog | Our Projects | Guest Book | About | Contact

 
Code Snippet - Disable Console X Button
Author:Arkon
Category:Win32API
File Size:218 Bytes
Uploaded at:23-Apr-03 11:08:05 am
Description:
  Shows how to disable the console Close button.
It simply removes it from the menu bar...
  
// GetConsoleWindow supported for Win2000 and later.
#define _WIN32_WINNT (0x0500)
#include <windows.h>
DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_BYCOMMAND);
DrawMenuBar(GetConsoleWindow());
User Contributed Comments(3)
 [1] m.oette | 2005-12-15 19:45:22

nice hint.

usefull even for vb ;-)
 [2] arkon | 2007-03-21 16:08:45

this line will disable the close button of a normal window.
EnableMenuItem(GetSystemMenu(hwndDlg, FALSE), SC_CLOSE, MF_GRAYED);
 [3] Nick | 2007-06-10 15:16:51

I am a newbie to code....this is just what we are looking for for one of our applications..what are the steps to get this to work...
NOTE:
Comments that will hurt anyone in any way will be deleted.
Don't ask for features, advertise or curse.
If you want to leave a message to the author use the contacts,
if you have any question in relation to your comments please use the forum.
Comments which violate any of these requests will be deleted without further
notice. Use the comment system decently.

Post your comment:
Name:
email:
Comment:
::Top 5 Tutorials::
Embedded Python[116397]
2D Rotated Rectangles Collision Detection[88469]
Keyboard Hook[76725]
UDP[65659]
HTTP Proxy[41049]

::Top 5 Samples::
2D ColDet Rotated Rectangles[11531]
PS2 Mouse Driver[6928]
Wave Format Player[5764]
Reading FAT12[5591]
CodeGuru[5327]


All rights reserved to RageStorm © 2009