본문 바로가기

개발/mfc

mfc AfxMessageBox 응답 받기

반응형

mfc AfxMessageBox 응답 받기, vs2010

 

1. 그냥 아래처럼 쓰면 됩니다.

if( IDYES == AfxMessageBox(_T("Are you OK ?"), MB_YESNO) ) {
	AfxMessageBox(_T("Good ?")
} else {
	AfxMessageBox(_T("Why ?")
}

 

 

2. MB_YESNO 대신 들어 갈거 뭐 디파인 찾어 보시면 됩니다.

/*
 * MessageBox() Flags
 */
#define MB_OK                       0x00000000L
#define MB_OKCANCEL                 0x00000001L
#define MB_ABORTRETRYIGNORE         0x00000002L
#define MB_YESNOCANCEL              0x00000003L
#define MB_YESNO                    0x00000004L
#define MB_RETRYCANCEL              0x00000005L
#if(WINVER >= 0x0500)
#define MB_CANCELTRYCONTINUE        0x00000006L
#endif /* WINVER >= 0x0500 */

 

3.  IDYES 대신 들어 갈거..

/*
 * Dialog Box Command IDs
 */
#define IDOK                1
#define IDCANCEL            2
#define IDABORT             3
#define IDRETRY             4
#define IDIGNORE            5
#define IDYES               6
#define IDNO                7
#if(WINVER >= 0x0400)
#define IDCLOSE         8
#define IDHELP          9
#endif /* WINVER >= 0x0400 */

 

이상 입니다.

 

반응형