filechoosernativewin32: Set default extension

Setting the default extension before a filter is selected allows
the IFileDialog to automatically change the extension when the
filter is changed. See:
https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifiledialog-setdefaultextension
This commit is contained in:
robxnano 2022-11-26 14:09:40 +00:00
parent 10689066e3
commit c1aec7f100
No known key found for this signature in database
GPG Key ID: 0E26B375E2B7DC05

View File

@ -610,6 +610,10 @@ filechooser_win32_thread (gpointer _data)
if (FAILED (hr))
g_warning_hr ("Can't set file types", hr);
hr = IFileDialog_SetDefaultExtension (pfd, L"");
if (FAILED (hr))
g_warning_hr ("Can't set default extension", hr);
if (data->self->current_filter)
{
GSList *filters = gtk_file_chooser_list_filters (GTK_FILE_CHOOSER (data->self));