Program Language/API | MFC

[MFC] Frame Caption 고정하기

야곰야곰+책벌레 2022. 4. 15. 13:47
728x90
반응형

Single/Multi Document 에서 상단 Caption은 보통 '제목없음 - 프로젝트 이름'으로 나타난다.

이를 해결하기 위해서는 Frame의 Style 설정에서 TITLE을 변경하면 된다.

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	cs.style &= ~(FWS_ADDTOTITLE);
	cs.lpszName = L"User Application";

	return TRUE;
}

Frame Style에서 FWS_ADDTOTITLE을 제거하고 lpszName에 원하는 이름을 적어두면 원하는 이름을 계속 유지할 수 있다.

728x90
반응형