Window를 non-sizable, non-movable하게 만들려면 아래와 같이 code를 추가한다.
[code]
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
......
//Remove positions of menu
CMenu* pTopMenu = GetSystemMenu(FALSE);
pTopMenu -> RemoveMenu(4,MF_BYPOSITION); //Maximize
pTopMenu -> RemoveMenu(2,MF_BYPOSITION); //Size
pTopMenu -> RemoveMenu(1,MF_BYPOSITION); //Move
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.style &= ~WS_THICKFRAME;
//If you use buttons MAXIMIZE and MINIMIZE in the caption,
// insert next string!!!!!!
cs.style &= ~WS_MAXIMIZEBOX;
return TRUE;
}
[/code]
[code]
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
......
//Remove positions of menu
CMenu* pTopMenu = GetSystemMenu(FALSE);
pTopMenu -> RemoveMenu(4,MF_BYPOSITION); //Maximize
pTopMenu -> RemoveMenu(2,MF_BYPOSITION); //Size
pTopMenu -> RemoveMenu(1,MF_BYPOSITION); //Move
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.style &= ~WS_THICKFRAME;
//If you use buttons MAXIMIZE and MINIMIZE in the caption,
// insert next string!!!!!!
cs.style &= ~WS_MAXIMIZEBOX;
return TRUE;
}
[/code]
'Windows > MFC' 카테고리의 다른 글
드라이브 타입 알기 (0) | 2013.10.02 |
---|---|
쓰레드 없이 장기간의 작업을 원활히 하려면??? (0) | 2013.10.02 |
가운데, 중앙에 윈도우 위치하기 (CenterWindow) (0) | 2013.10.02 |
메인 윈도우 타이틀을 변경 (Change Title) (0) | 2013.10.02 |
파일명 반환(return filename) (0) | 2013.10.02 |