// 헤더 파일에 추가.
HANDLE mh_program_state;
// OnInitDialog()에 추가.
BOOL CMFCApplication1Dlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
mh_program_state = CreateMutex(NULL, FALSE, L"프로젝트명");
if (ERROR_ALREADY_EXISTS == GetLastError()) {
MessageBox(L"이미 열려 있음.");
DestroyWindow();
return FALSE;
}
return TRUE; // return TRUE unless you set the focus to a control
}
'MFC > MFC 관련 설명 모음' 카테고리의 다른 글
Visual Studio 프로젝트 버전 확인 하는 방법 (0) | 2022.01.07 |
---|---|
[MFC] 실행파일 아이콘 변경하는 방법 (0) | 2021.07.30 |
MFC Gride Control 추가2 - Cell Merge (0) | 2021.07.28 |
MFC Gride Control 추가. (0) | 2021.07.28 |
[MFC] 레지스트리 에서 키 정보 가져오기. (0) | 2021.07.09 |