Skip to content

Commit f5e907f

Browse files
yaira2hishitetsu
andauthored
Fix: Fixed crash when creating taskbar progress (#14190)
Co-authored-by: hishitetsu <66369541+hishitetsu@users.noreply.github.com>
1 parent d638827 commit f5e907f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Files.App/Utils/Shell/Win32API.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,18 +568,17 @@ public static Task<bool> MountVhdDisk(string vhdPath)
568568

569569
public static Shell32.ITaskbarList4? CreateTaskbarObject()
570570
{
571-
var taskbar2 = new Shell32.ITaskbarList2();
572571
try
573572
{
573+
var taskbar2 = new Shell32.ITaskbarList2();
574574
taskbar2.HrInit();
575+
return taskbar2 as Shell32.ITaskbarList4;
575576
}
576-
catch (NotImplementedException)
577+
catch (Exception)
577578
{
578579
// explorer.exe is not running as a shell
579580
return null;
580581
}
581-
582-
return taskbar2 as Shell32.ITaskbarList4;
583582
}
584583

585584
private static Bitmap GetAlphaBitmapFromBitmapData(BitmapData bmpData)

0 commit comments

Comments
 (0)