본문 바로가기
컴퓨터과학[2-1]/knou_[2-1]Visual_C

MFC Keyboard 윈도우를 종료하는 네가지 방법

by boolean 2015. 4. 2.
728x90

MFC Keyboard & Message


Keyboard 윈도우를 종료하는 네가지 방법

Alt + X 또는 Alt + x 로 윈도우 종료하는 단축키

void CKeyMoveView::OnSysChar(UINT nChar, UINT nRepCnt, UINT nFlags)    //단축키 처리 키보드로 구현
{
	// TODO: Add your message handler code here and/or call default
	if(nChar == 'x' || nChar == 'X')
        {	
		AfxMessageBox(TEXT("Alt + X"));
		AfxGetMainWnd()->PostMessage(WM_CLOSE);
               //윈도우를 종료하는 여러가지 방법
               //AfxGetMainWnd()       -> PostMessage(WM_CLOSE);
               //GetParentFrame()       -> PostMEssage(WM_CLOSE);
               //theApp.m_pMainWnd  -> PostMessage(WM_CLOSE);
              //theApp.GetMainWnd() -> PostMessage(WM_CLOSE);

	}
}


댓글