AfxMessageBox("Are you sure?",MB_YESNO|MB_ICONQUESTION);
int a = MessageBox( "是否确认删除?" , "Warning!!",MB_YESNO|MB_ICONWARNING);
if (a == IDYES)
AfxMessageBox("Yes");
else
AfxMessageBox("No");
Messagebox函数在API和MFC里的区别:
API的定义如下
int MessageBox(
HWND hWnd, // handle of owner window
LPCTSTR lpText, // address of text in message box
LPCTSTR lpCaption, // address of title of message box
UINT uType // style of message box
);