How do I retrieve system image list for given DPI?
When an application is system DPI-aware, the SHGetFileInfo
and similar functions return a handle to a correctly scaled system image list. C++ example:
handle =
SHGetFileInfo(L"", 0, &fileInfo, sizeof(fileInfo),
SHGFI_SYSICONINDEX | (large ? SHGFI_LARGEICON : SHGFI_SMALLICON));
But with per-monitor DPI awareness, that's not enough, as the application can run on a monitor that does not use system DPI (or the application can have multiple windows, each on different monitor, with different DPI).
For example, on 168 DPI (175% zoom) monitor, with standard 96 system DPI, you get small unscaled 16x16 icons:
So I'm hoping, that there's a DPI-aware variant to the SHGetFileInfo
(or similar), the way there are DPI aware variants of other functions like:
SHGetImageList
to return the jumbo 256x256 icons if that's what you need. Upon looking at it again I suspect I originally got it from here – MickyDHIMAGELIST hImageList = reinterpret_cast<HIMAGELIST>(IImageList);
fwiw. – Jonathan Potter