Hello, I am trying to implement a two-button message box (for errors and warnings) and I'd like one of the buttons to be something like "Log to File" and the other to be something like "Close". I haven't been able to find any way to rename the buttons, however.
This is what I have so far (code that implements and "OK/Cancel" type messagebox):
// This section just fills in the data for MessageBox call
//----------------------------------------------------
LPCTSTR lpszText = ErrorText.Getstring();
LPCTSTR lpszCaption;
switch(Error_or_Warning)
{
case FATAL_ERROR: lpszCaption = "ERROR"; break;
case WARNING: lpszCaption = "WARNING"; break;
default: lpszCaption = "ERROR"; break;
}
UINT nType = MB_ICONERROR | MB_OKCANCEL | MB_APPLMODAL;
//--------------------------------------------------------
// This section calls MessageBox and handles its callback
switch(MessageBox(hwnd, lpszText, lpszCaption, nType))
{
case IDOK: Log_Error_to_File(ERRORFILEPATHANDFILENAME, Error_ID_Found, Error_Label);
break;
case IDCANCEL : break;
default: break;
}
This is what I have so far (code that implements and "OK/Cancel" type messagebox):
// This section just fills in the data for MessageBox call
//----------------------------------------------------
LPCTSTR lpszText = ErrorText.Getstring();
LPCTSTR lpszCaption;
switch(Error_or_Warning)
{
case FATAL_ERROR: lpszCaption = "ERROR"; break;
case WARNING: lpszCaption = "WARNING"; break;
default: lpszCaption = "ERROR"; break;
}
UINT nType = MB_ICONERROR | MB_OKCANCEL | MB_APPLMODAL;
//--------------------------------------------------------
// This section calls MessageBox and handles its callback
switch(MessageBox(hwnd, lpszText, lpszCaption, nType))
{
case IDOK: Log_Error_to_File(ERRORFILEPATHANDFILENAME, Error_ID_Found, Error_Label);
break;
case IDCANCEL : break;
default: break;
}