How do I disable system menu buttons
-
I want to display the minimize box only and not the close or maximize buttons. Is there any way to do this? Alternatively is there any way to add a button to the title bar and use it instead. Thanx...
To disabled the maximize button do this in PreCreateWindow() BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style&=~WS_MAXIMIZEBOX; return TRUE; } To disable system menu do this: cs.style&=~WS_SYSMENU; Jerzy
-
To disabled the maximize button do this in PreCreateWindow() BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style&=~WS_MAXIMIZEBOX; return TRUE; } To disable system menu do this: cs.style&=~WS_SYSMENU; Jerzy
This only grays out the MAX box... > cs.style&=~WS_MAXIMIZEBOX; This disables the entire menu... > cs.style&=~WS_SYSMENU; What I need is remove the maximize and close buttons, not just gray them out. I only want the minimize button to appear. But thanx anyway...
-
This only grays out the MAX box... > cs.style&=~WS_MAXIMIZEBOX; This disables the entire menu... > cs.style&=~WS_SYSMENU; What I need is remove the maximize and close buttons, not just gray them out. I only want the minimize button to appear. But thanx anyway...
You can draw it yourself (e.g. winamp) BTW: for some of you that wished for CodeProject irc server I create a channle on
DalNet
called "#CodeProject
" -
You can draw it yourself (e.g. winamp) BTW: for some of you that wished for CodeProject irc server I create a channle on
DalNet
called "#CodeProject
" -
This only grays out the MAX box... > cs.style&=~WS_MAXIMIZEBOX; This disables the entire menu... > cs.style&=~WS_SYSMENU; What I need is remove the maximize and close buttons, not just gray them out. I only want the minimize button to appear. But thanx anyway...
Is it the main app window? How bout:
HMENU hmenu = GetSystemMenu ( hwnd, FALSE ); DeleteMenu ( hmenu, SC\_CLOSE, MF\_BYCOMMAND );
later Oops - just realized that you want to get rid of the buttons entirely - this won't do it. You may have to take over WM_NCPAINT handling...