Windows: Allow read only files in load dialog.

This commit is contained in:
Unknown W. Brackets 2020-01-04 09:35:00 -08:00
parent 97ac18ceee
commit c222ff0bf7

View File

@ -66,7 +66,9 @@ namespace W32Util
ofn.nMaxFileTitle = 0;
ofn.lpstrDefExt = _pExtension;
ofn.hwndOwner = _hParent;
ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_HIDEREADONLY;
ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER;
if (!_bLoad)
ofn.Flags |= OFN_HIDEREADONLY;
int success = _bLoad ? GetOpenFileName(&ofn) : GetSaveFileName(&ofn);
if (success == 0 && CommDlgExtendedError() == FNERR_BUFFERTOOSMALL) {
@ -103,7 +105,9 @@ namespace W32Util
ofn.nMaxFileTitle = 0;
ofn.lpstrDefExt = _pExtension;
ofn.hwndOwner = _hParent;
ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT;
ofn.Flags = OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_ALLOWMULTISELECT;
if (!_bLoad)
ofn.Flags |= OFN_HIDEREADONLY;
std::vector<std::string> files;
int success = _bLoad ? GetOpenFileName(&ofn) : GetSaveFileName(&ofn);