pub trait comctl_Himagelist: Handle {
    // Provided methods
    fn Add(
        &self,
        hbmp_image: &HBITMAP,
        hbmp_mask: Option<&HBITMAP>
    ) -> SysResult<u32> { ... }
    fn AddIcon(&self, hicon: &HICON) -> SysResult<u32> { ... }
    fn AddMasked(
        &self,
        hbmp_image: &HBITMAP,
        color_mask: COLORREF
    ) -> SysResult<u32> { ... }
    fn BeginDrag(
        &self,
        itrack: u32,
        hotspot: POINT
    ) -> SysResult<ImageListEndDragGuard<'_>> { ... }
    fn Create(
        image_sz: SIZE,
        flags: ILC,
        initial_size: i32,
        grow_size: i32
    ) -> SysResult<ImageListDestroyGuard> { ... }
    fn DragMove(&self, x: i32, y: i32) -> SysResult<()> { ... }
    fn DragShowNolock(show: bool) -> SysResult<()> { ... }
    fn GetIconSize(&self) -> SysResult<SIZE> { ... }
    fn GetImageCount(&self) -> u32 { ... }
    fn Remove(&self, index: Option<u32>) -> SysResult<()> { ... }
    fn ReplaceIcon(
        &self,
        index: Option<u32>,
        hicon_new: &HICON
    ) -> SysResult<u32> { ... }
    fn SetImageCount(&self, new_count: u32) -> SysResult<()> { ... }
}
Available on crate features kernel and comctl only.
Expand description

This trait is enabled with the comctl feature, and provides methods for HIMAGELIST.

Prefer importing this trait through the prelude:

use winsafe::prelude::*;

Provided Methods§

source

fn Add( &self, hbmp_image: &HBITMAP, hbmp_mask: Option<&HBITMAP> ) -> SysResult<u32>

ImageList_Add function.

A copy of the bitmap is made and stored in the image list, so you’re free to release the original bitmap.

source

fn AddIcon(&self, hicon: &HICON) -> SysResult<u32>

ImageList_AddIcon function.

A copy of the icon is made and stored in the image list, so you’re free to release the original icon.

source

fn AddMasked( &self, hbmp_image: &HBITMAP, color_mask: COLORREF ) -> SysResult<u32>

ImageList_AddMasked function.

A copy of the bitmap is made and stored in the image list, so you’re free to release the original bitmap.

source

fn BeginDrag( &self, itrack: u32, hotspot: POINT ) -> SysResult<ImageListEndDragGuard<'_>>

ImageList_BeginDrag function.

In the original C implementation, you must call ImageList_EndDrag as a cleanup operation.

Here, the cleanup is performed automatically, because BeginDrag returns an ImageListEndDragGuard, which automatically calls ImageList_EndDrag when the guard goes out of scope. You must, however, keep the guard alive, otherwise the cleanup will be performed right away.

§Examples
use winsafe::{self as w, prelude::*};

let himgl: w::HIMAGELIST; // initialized somewhere

let _drag = himgl.BeginDrag(0, w::POINT::new(0, 0))?; // keep guard alive
source

fn Create( image_sz: SIZE, flags: ILC, initial_size: i32, grow_size: i32 ) -> SysResult<ImageListDestroyGuard>

ImageList_Create function.

§Examples
use winsafe::{self as w, prelude::*, co};

let himgl = w::HIMAGELIST::Create(
    w::SIZE::new(16, 16),
    co::ILC::COLOR32,
    1,
    1,
)?;

// ImageList_Destroy() automatically called
source

fn DragMove(&self, x: i32, y: i32) -> SysResult<()>

source

fn DragShowNolock(show: bool) -> SysResult<()>

source

fn GetIconSize(&self) -> SysResult<SIZE>

source

fn GetImageCount(&self) -> u32

source

fn Remove(&self, index: Option<u32>) -> SysResult<()>

ImageList_Remove function.

source

fn ReplaceIcon(&self, index: Option<u32>, hicon_new: &HICON) -> SysResult<u32>

ImageList_ReplaceIcon function.

Note that a copy of the bitmap is made, and this copy is then stored. You’re still responsible for freeing the original bitmap.

source

fn SetImageCount(&self, new_count: u32) -> SysResult<()>

Object Safety§

This trait is not object safe.

Implementors§