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:
SHGFI_LARGEICON
). As I need even the "large" icons in my application, I need even larger than 32x32 on high DPI monitor. – AnxietySHGetImageList
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 – MacruranSHGetImageList
supports larger icon sizes. While that's possibly an acceptable workaround, it would be a huge change to my code. I'm looking for a handle to the system image list. While theSHGetImageList
gets youIImageList
. – AnxietyHIMAGELIST hImageList = reinterpret_cast<HIMAGELIST>(IImageList);
fwiw. – ColeoptileIImageList
interface? – AnxietySHGetImageList
provides 4 icons sizes only. What is better than the two I have atm, but still not enough for all DPI's. – Anxiety