Get large icon from file extension

前端 未结 3 837
轮回少年
轮回少年 2021-02-09 03:43

There are several places that talk about how to get an icon from a file extension such as this one and this other one. After several hours of playing around with this kind of pr

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 04:03

    The code you're referencing only uses 2 sizes:

    public const uint SHGFI_LARGEICON = 0x000000000;     // get large icon
    public const uint SHGFI_SMALLICON = 0x000000001;     // get small icon
    

    to get the extra_large size, you need to add your own define (and add another enum for calling functions):

    public const uint SHGFI_EXTRALARGEICON = 0x000000002;     // get extra large icon
    

    or if you just want a quick fix, replace 0x000000000 with 0x000000002 in the original large definition.

    Here are all icon sizes: http://msdn.microsoft.com/en-us/library/windows/desktop/bb762185%28v=vs.85%29.aspx

提交回复
热议问题