From 752b41e301fc2c05432f44743347062e265a47dc Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 3 May 2020 17:06:22 +0000 Subject: [PATCH] case 3751 --- source/WinFormApp/Util.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/WinFormApp/Util.cs b/source/WinFormApp/Util.cs index 3c8b044..f50dae6 100644 --- a/source/WinFormApp/Util.cs +++ b/source/WinFormApp/Util.cs @@ -7160,6 +7160,10 @@ At first I was happy to find your code that solved my problem, but I did not lik //extract one selected by index icon from a file. public static Icon IconFromFile(string Filename, IconSize Size, int Index) { + + //case 3751 + if (!File.Exists(Filename)) return null; + int IconCount = ExtractIconEx(Filename, -1, null, null, 0); //checks how many icons. if (IconCount < Index) return null; // no icons was found.