The
AfxMessageBox[
^] return value can be used to determine which button was pressed by the user. When using the style
MB_OKCANCEL
the function returns
IDOK
when the OK button is pressed and
IDCANCEL
when the cancel button is used.
if( AfxMessageBox( strMessage, MB_OKCANCEL) == IDCANCEL )
{
}