hi,
can anyone tell me what win32 functions i need to call to disabled th applications close button, the one in the top right hand corner..
Thanks
This is a discussion on how to disable the application close button? within the Windows Programming forums, part of the Platform Specific Boards category; hi, can anyone tell me what win32 functions i need to call to disabled th applications close button, the one ...
hi,
can anyone tell me what win32 functions i need to call to disabled th applications close button, the one in the top right hand corner..
Thanks
If you know the window handle:
Code:HMENU hSysMenu = GetSystemMenu(hMyWindow, FALSE); EnableMenuItem(hSysMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
sweet! thanks very much, that's exactly what i was after![]()
I would advise against doing that though. Who likes running programs that they don't have control of?
I don't see why people think Chuck Norris is so awesome. If he was really as great as they say, he would be over here slamming my head into the keybsk;lah;flksalfksdnlcslcnsldk;acklsd;glfbaskfl
/* When I wrote this, only God and I understood what I was doing... Now, God only knows */
If you have a specific close button or an OK button in a dialog, for example, this might be used. You can use it, you just need to be careful where you use it.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
You can still do ALT-F4 or force it closed via task manager. I cant think of any legitimate reason to grey it out, probably some malware.
Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.
I've had legitimate reasons to disable the close button myself.
Usually I do it when I don't want someone to "close" the dialog when it makes no sense. For example, when you have to click a specific set of buttons. Which one of these does close represent? May be confusing to the user, too, in which case I would disable it.
A typical yes/no set of buttons, perhaps.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Windows automaticly disables the close button on Yes/No message boxs.
I don't see why people think Chuck Norris is so awesome. If he was really as great as they say, he would be over here slamming my head into the keybsk;lah;flksalfksdnlcslcnsldk;acklsd;glfbaskfl
/* When I wrote this, only God and I understood what I was doing... Now, God only knows */
Which is a good example of when you can and should disable the close button.
I was referring more to custom dialogs which contains choices.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^