ImageList2

wraps the IImageList2 interface and provides additional methods for manipulating and interacting with image lists.

Authors

License

Documentation

Requirements

AutoHotkeyAHK v2 alpha
OSWindows Vista / Windows Server 2008 or newer
Base classesUnknown, ImageList
Helper classesILGOS, ILDI, ILFIP, IMAGELISTDRAWPARAMS, IMAGELISTSTATS, ILC, ILR
Summary
ImageList2wraps the IImageList2 interface and provides additional methods for manipulating and interacting with image lists.
Variables
CLSIDThis is CLSID_ImageList.
IIDThis is IID_IImageList2.
Functions
ResizeResizes the current image.
GetOriginalSizeGets the original size of a specified image.
SetOriginalSizeSets the original size of a specified image.
SetCallbackNot implemented
GetCallbackNot implemented
ForceImagePresentForces an image present, as specified.
DiscardImagesDiscards images from list, as specified.
PreloadImagesPreloads images, as specified.
GetStatisticsGets an image list statistics structure.
InitializeInitializes an image list.
Replace2Replaces an image in an image list.
ReplaceFromImageListReplaces an image in one image list with an image from another image list.

Variables

CLSID

This is CLSID_ImageList.  It is required to create an instance.

IID

This is IID_IImageList2.  It is required to create an instance.

Functions

Resize

Resize(width,
height)

Resizes the current image.

Parameters

INT widththe new width in pixels
INT heightthe new height in pixels

Returns

BOOL successtrue on success, false otherwise

Remarks

To set the present image, use ForceImagePresent.

GetOriginalSize

GetOriginalSize( index,
 flags,
byRef width,
byRef height)

Gets the original size of a specified image.

Parameters

INT indexThe index of desired image.
UINT flagsFlags for getting original size.  You can use one of the fields of the ILGOS class for convenience.
byRef INT widthreceives the original width
byRef INT heightreceives the original height

Returns

BOOL successtrue on success, false otherwise

SetOriginalSize

SetOriginalSize(index,
width,
height)

Sets the original size of a specified image.

Parameters

INT indexThe index of desired image.
INT widththe width
INT heightthe height

Returns

BOOL successtrue on success, false otherwise

SetCallback

SetCallback(p*)

Not implemented

GetCallback

GetCallback(p*)

Not implemented

ForceImagePresent

ForceImagePresent(index,
flags)

Forces an image present, as specified.

Parameters

INT indexthe image to set as present
UINT flagsForce image flags.  You may use one of the fields of the ILFIP class.

Returns

BOOL successtrue on success, false otherwise

DiscardImages

DiscardImages(start,
end,
flags)

Discards images from list, as specified.

Parameters

INT startthe index of the first image to discard.
INT endthe index of last image to discard.
UINT flagsDiscard images flags.  You may use the fields of the ILDI class for convenience.

Returns

BOOL successtrue on success, false otherwise

PreloadImages

PreloadImages(params)

Preloads images, as specified.

Parameters

IMAGELISTDRAWPARAMS paramseither an instance of the IMAGELISTDRAWPARAMS class or a pointer to a valid IMAGELISTDRAWPARAMS struct.

Returns

BOOL successtrue on success, false otherwise

GetStatistics

GetStatistics()

Gets an image list statistics structure.

Returns

IMAGELISTSTATS statisticsan instance of the IMAGELISTSTATS class describing the image list

Initialize

Initialize(width,
height,
flags,
initial,
max)

Initializes an image list.

Parameters

INT widthWidth, in pixels, of each image.
INT heightHeight, in pixels, of each image.
UINT flagsA combination of Image List Creation Flags.  You can use the fields of the ILC class for convenience.
INI initialNumber of images that the image list initially contains.
INT maxNumber of new images that the image list can contain.

Returns

BOOL successtrue on success, false otherwise

Replace2

Replace2( index,  
 image,  
 flags,  
mask : =  0,
punk : =  0)

Replaces an image in an image list.

Parameters

INT indexthe index of the image to replace.
HBITMAP imageA handle to the bitmap that contains the new image.
UINT flagsSpecifies how the mask is applied to the image as one or a bitwise combination of the flags in the ILR class.
[opt] HBITMAP maskA handle to the bitmap that contains the mask.  If no mask is used with the image list, this parameter is ignored.
[opt] IUnknown punkA pointer to the IUnknown interface.  (not sure what this does)

Returns

BOOL successtrue on success, false otherwise

ReplaceFromImageList

ReplaceFromImageList( index,  
 src,  
 srcIndex,  
punk : =  0)

Replaces an image in one image list with an image from another image list.

Parameters

INT indexThe index of the destination image in the image list.  This is the image that is overwritten by the new image.
ImageList srceither an ImageList instance pointing to the source image list or a raw pointer such as returned by IL_Create()
INT srcIndexThe index of the source image in the image list pointed to by src.
[opt] IUnknown punkA pointer to the IUnknown interface.  (not sure what this does)

Returns

BOOL successtrue on success, false otherwise
Resize(width,
height)
Resizes the current image.
GetOriginalSize( index,
 flags,
byRef width,
byRef height)
Gets the original size of a specified image.
SetOriginalSize(index,
width,
height)
Sets the original size of a specified image.
SetCallback(p*)
Not implemented
GetCallback(p*)
Not implemented
ForceImagePresent(index,
flags)
Forces an image present, as specified.
DiscardImages(start,
end,
flags)
Discards images from list, as specified.
PreloadImages(params)
Preloads images, as specified.
GetStatistics()
Gets an image list statistics structure.
Initialize(width,
height,
flags,
initial,
max)
Initializes an image list.
Replace2( index,  
 image,  
 flags,  
mask : =  0,
punk : =  0)
Replaces an image in an image list.
ReplaceFromImageList( index,  
 src,  
 srcIndex,  
punk : =  0)
Replaces an image in one image list with an image from another image list.