[MSPAINT] Some bug fixes on loading/saving files (#5385)

- Display a correct error message on failing to save a file.
- Don't confuse the main file info and the non-main file info.
- Rename ShowFileLoadError as ShowError, and strengthen and move it to dialogs.cpp.
- Add SetFileInfo and InitializeImage helper functions.
- Add IDS_SAVEERROR resource string.
- Modify SaveDIBToFile, SetBitmapAndInfo, and DoLoadImageFile functions.
CORE-18867
This commit is contained in:
Katayama Hirofumi MZ 2023-07-05 12:06:22 +09:00 committed by GitHub
parent 17e9dcc922
commit 3e23cdf9ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 150 additions and 109 deletions

View file

@ -22,6 +22,22 @@ CFontsDialog fontsDialog;
/* FUNCTIONS ********************************************************/
void ShowError(INT stringID, ...)
{
va_list va;
va_start(va, stringID);
CStringW strFormat, strText;
strFormat.LoadString(stringID);
strText.FormatV(strFormat, va);
CStringW strProgramName;
strProgramName.LoadString(IDS_PROGRAMNAME);
mainWindow.MessageBox(strText, strProgramName, MB_ICONERROR);
va_end(va);
}
LRESULT CMirrorRotateDialog::OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
CheckDlgButton(IDD_MIRRORROTATERB1, BST_CHECKED);