systemicons 0.9.13

With this lib you can retrive the system icon which is associated to a certain file extension. The icon will be in the .png format. Windows, macOS and Linux (GTK) are supported.
Documentation
use windows::Win32::{
    Graphics::Gdi::{
        DeleteDC, DeleteObject, HBITMAP, HDC
    }, UI::WindowsAndMessaging::{DestroyIcon, HICON}
};

pub struct IconDropper(pub HICON);

impl Drop for IconDropper {
    fn drop(&mut self) {
        if !self.0.is_invalid() {
            unsafe { let _ = DestroyIcon(self.0); };
        }
    }
}

pub struct BitmapDropper(pub HBITMAP);

impl Drop for BitmapDropper {
    fn drop(&mut self) {
        if !self.0.is_invalid() {
            unsafe { let _ = DeleteObject(self.0); };
        }
    }
}

pub struct DcDropper(pub HDC);

impl Drop for DcDropper {
    fn drop(&mut self) {
        if !self.0.is_invalid() {
            unsafe { let _ = DeleteDC(self.0); };
        }
    }
}