diff --git a/CHANGELOG.md b/CHANGELOG.md index b6c5981d..eee198d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ - Initial GA Actions Support - Added New Target .NET 7.0 +- Fix TaskDialog.DefaultButton property is ignored +- remove first dot in extension ### 2022-11-04 diff --git a/source/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialog.cs b/source/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialog.cs index 9765b364..1ee9aab5 100644 --- a/source/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialog.cs +++ b/source/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialog.cs @@ -815,7 +815,11 @@ private void ApplyControlConfiguration(NativeTaskDialogSettings settings) } // Set default button and add elevation icons to appropriate buttons. - settings.NativeConfiguration.defaultButtonIndex = FindDefaultButtonId(sourceList); + var defaultBtn = FindDefaultButtonId(sourceList); + if (defaultBtn != TaskDialogNativeMethods.NoDefaultButtonSpecified) + { + settings.NativeConfiguration.defaultButtonIndex = defaultBtn; + } ApplyElevatedIcons(settings, sourceList); } diff --git a/source/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilter.cs b/source/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilter.cs index 2f3dbfb4..30b0b147 100644 --- a/source/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilter.cs +++ b/source/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilter.cs @@ -128,7 +128,7 @@ private static string NormalizeExtension(string rawExtension) int indexOfDot = rawExtension.IndexOf('.'); if (indexOfDot != -1) { - rawExtension.Remove(indexOfDot); + rawExtension = rawExtension.Substring(indexOfDot + 1); } return rawExtension;