MDI non-themed max/min boxes
-
Hello. When creating a MDI application (with MFC AppWizard VC++ 6.0) you have the choice of excluding the maximize/minimize boxes for the child frames. When creating my MDI app, I chose to not have the maximize/minimize boxes, but to have the child frames start in 'maximize mode'. However, when the child frames are viewed in 'maximized mode', the non-themed minimize and maximize buttons are still drawn. Is there a way to remove or at least disable the non-themed maximize/minimize buttons? ----------------- Genaro
-
Hello. When creating a MDI application (with MFC AppWizard VC++ 6.0) you have the choice of excluding the maximize/minimize boxes for the child frames. When creating my MDI app, I chose to not have the maximize/minimize boxes, but to have the child frames start in 'maximize mode'. However, when the child frames are viewed in 'maximized mode', the non-themed minimize and maximize buttons are still drawn. Is there a way to remove or at least disable the non-themed maximize/minimize buttons? ----------------- Genaro
You can remove
WS_MAXIMIZEBOX
andWS_MINIMIZEBOX
from the concerned window's style.BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
//Modify the Window class or styles here by modifying the CREATESTRUCT cs`cs.style&=~(WS_MAXIMIZEBOX|WS_MINIMIZEBOX);` if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE;
}
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
You can remove
WS_MAXIMIZEBOX
andWS_MINIMIZEBOX
from the concerned window's style.BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
//Modify the Window class or styles here by modifying the CREATESTRUCT cs`cs.style&=~(WS_MAXIMIZEBOX|WS_MINIMIZEBOX);` if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE;
}
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
I tried that in the BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) function. However, that only removes the boxes if the child frame is not in 'maximized mode'. What function should I edit/override to also remove the non-themed buttons (those show when in maximized mode)? Thank you very much, ----------------- Genaro
-
I tried that in the BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) function. However, that only removes the boxes if the child frame is not in 'maximized mode'. What function should I edit/override to also remove the non-themed buttons (those show when in maximized mode)? Thank you very much, ----------------- Genaro
This is going to be dirty... X| Remove
WS_SYSMENU
style from the window style.Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
This is going to be dirty... X| Remove
WS_SYSMENU
style from the window style.Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
Thank you very much for the help... I am almost there. The only thing is that removing the WS_SYSMENU also removes the [x], which I would like to keep. Is it possible to do that? Thanks, ----------------- Genaro
picazo wrote:
WS_SYSMENU also removes the [x],
Yeah that's why I told it's dirty.
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose: