WM_NCPAINT minimize/restore
-
Hi all, I have a mdi app where the child frames are always maximized. I want to get rid of (remove completely) the child minimize and restore buttons, but keep the close button that appear on the menu bar. So far, I have been able to disable the unwanted buttons in the CChildFrame::DefWindowProc function, by using
pSysMenu->DeleteMenu(SC_MINIMIZE,MF_BYCOMMAND);
pSysMenu->DeleteMenu(SC_RESTORE,MF_BYCOMMAND);I understand that to actually remove the buttons, rather than just disable them, I need to handle the WS_NCPAINT message. Can anyone tell me how and where I would do this? (sample code perhaps) Thanks in advanced, ----------------- Genaro
-
Hi all, I have a mdi app where the child frames are always maximized. I want to get rid of (remove completely) the child minimize and restore buttons, but keep the close button that appear on the menu bar. So far, I have been able to disable the unwanted buttons in the CChildFrame::DefWindowProc function, by using
pSysMenu->DeleteMenu(SC_MINIMIZE,MF_BYCOMMAND);
pSysMenu->DeleteMenu(SC_RESTORE,MF_BYCOMMAND);I understand that to actually remove the buttons, rather than just disable them, I need to handle the WS_NCPAINT message. Can anyone tell me how and where I would do this? (sample code perhaps) Thanks in advanced, ----------------- Genaro
Did you try ModifyStyle() or modify the window styles before its creation (in OnCreate() or else)? I modified dialog in this way, it should work for other windows.
A nice tool for optimizing your Microsoft html-help contents. Includeh10
-
Did you try ModifyStyle() or modify the window styles before its creation (in OnCreate() or else)? I modified dialog in this way, it should work for other windows.
A nice tool for optimizing your Microsoft html-help contents. Includeh10
-
I tried that, but perhaps I just used modifyStyle incorrectly. Can you please send me a code snippet of how you did it? Thanks, ----------------- Genaro
try UNIT uRemove=WS_MAXIMIZEBOX|WS_MINIMIZEBOX; //call pYourWnd->ModifyStyle(uRemove,0); //or call pYourWnd->ModifyStyle(uRemove,0,SWP_NOSIZE|SWP_NOMOVE);
A nice tool for optimizing your Microsoft html-help contents. Includeh10