Skip to content

Commit

Permalink
Show error if file does not exist in Windows open file dialog
Browse files Browse the repository at this point in the history
Suggested in #86.
  • Loading branch information
samangh committed Mar 10, 2024
1 parent 45082a8 commit 6323da2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion portable-file-dialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,9 @@ inline internal::file_dialog::file_dialog(type in_type,
{
if (options & opt::multiselect)
ofn.Flags |= OFN_ALLOWMULTISELECT;
ofn.Flags |= OFN_PATHMUSTEXIST;
if (in_type == type::open)
ofn.Flags |= OFN_FILEMUSTEXIST;
ofn.Flags |= OFN_PATHMUSTEXIST;

dll::proc<BOOL WINAPI (LPOPENFILENAMEW)> get_open_file_name(comdlg32, "GetOpenFileNameW");
if (get_open_file_name(&ofn) == 0)
Expand Down

0 comments on commit 6323da2

Please sign in to comment.