how to create a window ot dialog with fixed size?

In our daily work,we sometimes need a window or diaog which have a fixed size.Now i give the way to fullfill this target. If you project is based on SDI or MDI, that is to say you want fix you window size.

you can refer to following code:

 BOOL   CMainFrame::PreCreateWindow(CREATESTRUCT&   cs)

 {     if(   !CFrameWnd::PreCreateWindow(cs))  

   return   FALSE;    

 cs.style   &=~(WS_THICKFRAME);//note : remove this style.  return  

 CFrameWnd::PreCreateWindow(cs);

    }    

If you want to fix a dialog 's size.you can fix its size by modifywindow:

   ModifyStyle(WM_THICKFRAME,WM_DLGFRAME,0);   

你可能感兴趣的:(dialog)