Welcome to Microsoft Q&A!
According to the Doc:Icon scaling
When Windows displays your app's icon, it will look for an exact size match first. If there is no exact match it will look for the next size above and scale down.
I suggest you could try to use
LoadIconMetric instead of
Icons are extracted or created as follows.
If an exact size match is found in the resource, that icon is used.
If an exact size match cannot be found and a larger icon is available, a new icon is created by scaling the larger version down to the desired size.
If an exact size match cannot be found and no larger icon is available, a new icon is created by scaling a smaller icon up to the desired size.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.