Disabling the minimize / Maximize button
-
Hi All, I am trying to disable the minimize & maximize button in a dialog based application. The close button get's disable, but the other two are not disabled. The code i am using is CMenu* pSM = GetSystemMenu(FALSE); if(pSM) { pSM->EnableMenuItem(SC_CLOSE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); pSM->EnableMenuItem(SC_MAXIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); pSM->EnableMenuItem(SC_MINIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); } i am adding this code on OnInitDialog. Thanx in Advance Sujan
-
Hi All, I am trying to disable the minimize & maximize button in a dialog based application. The close button get's disable, but the other two are not disabled. The code i am using is CMenu* pSM = GetSystemMenu(FALSE); if(pSM) { pSM->EnableMenuItem(SC_CLOSE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); pSM->EnableMenuItem(SC_MAXIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); pSM->EnableMenuItem(SC_MINIMIZE, MF_GRAYED |MF_BYCOMMAND|MF_DISABLED); } i am adding this code on OnInitDialog. Thanx in Advance Sujan
Can you not just remove the
WS_MINIMIZEBOX
andWS_MAXIMIZEBOX
styles from the dialog template?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen