On a DPI monitor that supports a list of Windows system images

How to get a list of system images for a given DPI?

When an application supports system DPI, and similar functions return a handle to a properly scaled list of system images. C ++ example: SHGetFileInfo

handle =
  SHGetFileInfo(L"", 0, &fileInfo, sizeof(fileInfo),
                SHGFI_SYSICONINDEX | (large ? SHGFI_LARGEICON : SHGFI_SMALLICON));

But with DPI support for each monitor, this is not enough, because the application can run on a monitor that does not use system DPI (or the application can have several windows, each on a different monitor, with different DPIs).

For example, on a monitor with a resolution of 168 dpi (175% zoom) with a standard system resolution of 96 dpi, you get small unscaled 16x16 icons:

unscaled system icons

, SHGetFileInfo DPI SHGetFileInfo ( ), DPI , :

+5
1

SHGetImageList, @MickyD.

( @JonathanPotter):

IImageList IImageList, ppv, HIMAGELIST; , .

SHGetImageList , 0..SHIL_LAST.

ImageList_GetIconSize .

, DPI, .

, DPI, DPI DPI.

+3

Source: https://habr.com/ru/post/1674091/


All Articles