Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to remove SC_CLOSE from MenuItem

SVC1SVC1 Member Posts: 5
Hi,

I am trying unsuccessfully to remove the X icon from a window. I can make it unavailable, greyed out but cannot actually remove the icon.


HMENU hMenu = GetSystemMenu( Handle, FALSE );

I tried:
RemoveMenu(hMenu , SC_CLOSE , MF_BYCOMMAND);
DrawMenuBar( Handle );

I tried:

DeleteMenu( hMenu, SC_CLOSE , MF_BYCOMMAND);
DrawMenuBar( Handle );

It makes the clicking on the X un-operational but does not remove the icon.

Any hints,

Tx,
SVC

Comments

  • hellbellhellbell Member Posts: 2
    I don't thing that way that you are trying to remove close button from form is possible, because every window in windows is based on the one mail windows class which have in self code define close button, so if you are trying to remove in c++ builder close button and he as we say before is based on the operating system windows class, you can not remove it like you do just handle it to them. If you like change that you will have to go deeper in understading how work operating system, but there is oder easyest way to solve the problem, one is that you put new form and on the properties(object inspector)-> Border Style select -> bsDialog (which will hidde all on top buttons), and than on the space where hase been placed minimize&maximize put thsape (which will have pitcutres of that two button's). Or you can follow this tutorial and use it in your example
    http://msdn.microsoft.com/en-us/visualc/bb838685.aspx
Sign In or Register to comment.