pub fn add_icon(&self, icon: &Icon) -> i32 {
        use winapi::um::winuser::{GetIconInfo, ICONINFO};
        use winapi::um::wingdi::DeleteObject;

        if self.handle.is_null() { panic!("{}", NOT_BOUND); }
        if icon.handle.is_null() { panic!("Icon was not initialized"); }

        // Extract the bitmap from the icon
        // Can't use `ImageList_AddIcon` because it doesn't always guess the mask
        unsafe {
            let mut info: ICONINFO = ::std::mem::zeroed();
            GetIconInfo(icon.handle as _, &mut info);
            
            let i = ImageList_AddMasked(self.handle, info.hbmColor, 0);

            DeleteObject(info.hbmMask as _);
            DeleteObject(info.hbmColor as _);

            i
        }
    }
/// Adds a new icon to the image list. Returns the index to the image. Panics if the icon was not initialized
Adds a new icon to the image list. Returns the index to the image. Panics if the icon was not initialized
Adds a new icon to the image list . Returns the index to the image . Panics if the icon was not initialized
pub fn add_icon(&self, icon: &Icon) -> i32 {
        use winapi::um::winuser::{GetIconInfo, ICONINFO};
        use winapi::um::wingdi::DeleteObject;
        if self.handle.is_null() { panic!("{}", NOT_BOUND); }
        if icon.handle.is_null() { panic!("Icon was not initialized"); }
        // Extract the bitmap from the icon
        // Can't use `ImageList_AddIcon` because it doesn't always guess the mask
        unsafe {
            let mut info: ICONINFO = ::std::mem::zeroed();
            GetIconInfo(icon.handle as _, &mut info);
            let i = ImageList_AddMasked(self.handle, info.hbmColor, 0);
            DeleteObject(info.hbmMask as _);
            DeleteObject(info.hbmColor as _);
            i
        }
    }
pub fn add_icon ( & self , icon : & Icon ) -> i32 { use winapi :: um :: winuser :: { GetIconInfo , ICONINFO } ; use winapi :: um :: wingdi :: DeleteObject ; if self . handle . is_null ( ) { panic ! ( " " NOT_BOUND ) ; } if icon . handle . is_null ( ) { panic ! ( " " ) ; } // Extract the bitmap from the icon // Can't use `ImageList_AddIcon` because it doesn't always guess the mask unsafe { let mut info : ICONINFO = :: std :: mem :: zeroed ( ) ; GetIconInfo ( icon . handle as _ , & mut info ) ; let i = ImageList_AddMasked ( self . handle , info . hbmColor , 0 ) ; DeleteObject ( info . hbmMask as _ ) ; DeleteObject ( info . hbmColor as _ ) ; i } }
Adds a new icon to the image list.
Adds a new icon to the image list .
&self
icon
&Icon