Remove duplicate GetSystemMetrics
@@ -742,34 +742,21 @@ HICON PhLoadIcon(
if (!icon && !(Flags & PH_LOAD_ICON_STRICT))
{
+ INT width;
+ INT height;
+
if (Flags & PH_LOAD_ICON_SIZE_SMALL)
{
- static ULONG smallWidth = 0;
- static ULONG smallHeight = 0;
-
- if (!smallWidth)
- smallWidth = GetSystemMetrics(SM_CXSMICON);
- if (!smallHeight)
- smallHeight = GetSystemMetrics(SM_CYSMICON);
-
- Width = smallWidth;
- Height = smallHeight;
+ width = PhSmallIconSize.X;
+ height = PhSmallIconSize.Y;
}
- else if (Flags & PH_LOAD_ICON_SIZE_LARGE)
+ else
{
- static ULONG largeWidth = 0;
- static ULONG largeHeight = 0;
-
- if (!largeWidth)
- largeWidth = GetSystemMetrics(SM_CXICON);
- if (!largeHeight)
- largeHeight = GetSystemMetrics(SM_CYICON);
-
- Width = largeWidth;
- Height = largeHeight;
+ width = PhLargeIconSize.X;
+ height = PhLargeIconSize.Y;
}
- icon = LoadImage(ImageBaseAddress, Name, IMAGE_ICON, Width, Height, 0);
+ icon = LoadImage(ImageBaseAddress, Name, IMAGE_ICON, width, height, 0);
}
if (Flags & PH_LOAD_ICON_SHARED)
