Skip to content

Commit

Permalink
Fix: Fixed crash when creating taskbar progress (files-community#14190)
Browse files Browse the repository at this point in the history
Co-authored-by: hishitetsu <[email protected]>
  • Loading branch information
yaira2 and hishitetsu authored Dec 10, 2023
1 parent d638827 commit f5e907f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Files.App/Utils/Shell/Win32API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -568,18 +568,17 @@ public static Task<bool> MountVhdDisk(string vhdPath)

public static Shell32.ITaskbarList4? CreateTaskbarObject()
{
var taskbar2 = new Shell32.ITaskbarList2();
try
{
var taskbar2 = new Shell32.ITaskbarList2();
taskbar2.HrInit();
return taskbar2 as Shell32.ITaskbarList4;
}
catch (NotImplementedException)
catch (Exception)
{
// explorer.exe is not running as a shell
return null;
}

return taskbar2 as Shell32.ITaskbarList4;
}

private static Bitmap GetAlphaBitmapFromBitmapData(BitmapData bmpData)
Expand Down

0 comments on commit f5e907f

Please sign in to comment.