반응형

http://blog.naver.com/cysatan?Redirect=Log&logNo=10051502240



1. MSDN 설명

int AfxMessageBox(
   LPCTSTR lpszText,
   UINT nType = MB_OK,
   UINT nIDHelp = 0 
);
int AFXAPI AfxMessageBox(
   UINT nIDPrompt,
   UINT nType = MB_OK,
   UINT nIDHelp = (UINT) -1 
);
lpszText

Points to a CString object or null-terminated string containing the message to be displayed in the message box.

nType

The style of the message box. Apply any of the < >message-box :Track(?ctl00_MainContent_cpe90361_c|ctl00_MainContent_ctl05?,this);?>to the box.

nIDHelp

The Help context ID for the message; 0 indicates the application's default Help context will be used.

nIDPrompt

A unique ID used to reference a string in the string table.

 

2 . 기본설정

 

int AfxMessageBox(LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0);

 

MessageBox와는 달리 제목을 넣는 부분은 사라졌습니다.

 

Example)

 

AfxMessageBox(“메시지 박스 테스트”, MB_OK | MB_ICONEXCLAMATION);

 

 

nType은 다음 중에서 각각 하나씩 조합해서 사용할 수 있습니다.

 

버튼 스타일                                    의미

MB_ABORTRETRYIGNORE                [취소], [재시도], [무시]

MB_OK                                           [확인]

MB_OKCANCEL                               [확인], [취소]

MB_RETRYCANCEL                         [재시도], [취소]

MB_YESNO                                     [], [아니오]

MB_YESNOCANCEL                         [], [아니오], [취소]

 

 

아이콘 스타일                                  의미

MB_ICONEXCLAMATION                   [느낌표]

MB_ICONINFORMATION                    [느낌표]

MB_ICONQUESTION                          [물음표]

MB_ICONSTOP                                 [X]

 

 

디폴트 버튼                                     의미

MB_DEFBUTTON1                             첫 번째 버튼

MB_DEFBUTTON2                             두 번째 버튼

MB_DEFBUTTON3                             세 번째 버튼

 

 

모달리티                                         의미

MB_APPLMODAL                              메시지 박스를 종료시켜야 프로그램을 계속 진행할 수 있음

MB_SYSTEMMODAL                          메시지 박스를 종료시켜야 시스템을 사용할 수 있음

 

 

반환값                                            의미

IDABORT                                         [취소(Abort)]가 눌러 졌음

IDCANCEL                                       [취소(Cancel)]이 눌러 졌음

IDIGNORE                                        [무시]가 눌러 졌음

IDNO                                               [아니오]가 눌러 졌음

IDOK                                               [확인]이 눌러 졌음

IDRETRY                                          [재시도]가 눌러 졌음

IDYES                                             []가 눌러 졌음

3. 추가 옵션

 

CString temp;

int nScore;

nScore = 99;

 

temp.Format(_T("당신의 점수는 %d점입니다."), nScore);

AfxMessageBox(temp);

 

참고 : http://blog.naver.com/cysatan/10047219216

 

4. 기타

 

일일이 창띄워서 확인을 해야한다면 모르겠지만 아니라면

 

TRACE(""); 함수를 써도 괜찮은거같다.

 

괄호 안의 형식은 Afxmessagebox와 비슷하며 출력은 Output창에 표시된다.

 

 

 

출처: 0. http://msdn.microsoft.com/en-us/library/as6se7cb.aspx

1. AfxMessageBox()를 써 보자

2.  http://kin.naver.com/detail/detail.php?d1id=1&dir_id=10104&eid=uFAjiv1k4JmCyEjQuiylTjEnq1MrK8xU&qb=YWZ4bWVzc2FnZWJveA==&enc=utf8&section=kin&rank=1&sort=0&spq=0&pid=fCbs6doi5UNsscSEda0sss--387710&sid=SkFx15BeQUoAAAr4MIk

반응형

+ Recent posts