Using Win32 functions in Visual FoxPro Image Gallery
Windows Controls
..msdn
ImageList_Add
ImageList_Create
ImageList_Destroy
ImageList_GetIconSize
ImageList_GetImageCount
ImageList_GetImageInfo
ImageList_Remove
InitCommonControlsEx
Code examples:
How to view icons stored in executable files (Icon Viewer) - II
ImageList_Add
    Add comment     W32 Constants      Translate this page
Adds an image or images to an image list.
Code examples:
How to view icons stored in executable files (Icon Viewer) - II
Declaration:
int ImageList_Add(
    HIMAGELIST himl,
    HBITMAP hbmImage,
    HBITMAP hbmMask
);

FoxPro declaration:
DECLARE INTEGER ImageList_Add IN comctl32;
    INTEGER himl,;
    INTEGER hbmImage,;
    INTEGER hbmMask
Parameters:
himl
Handle to the image list.

hbmImage
Handle to the bitmap that contains the image or images. The number of images is inferred from the width of the bitmap.

hbmMask
Handle to the bitmap that contains the mask. If no mask is used with the image list, this parameter is ignored.

Return value:
Returns the index of the first new image if successful, or -1 otherwise.
Usage:
hIcon = ExtractIcon(0, cSourceFile, nIconIndex)

IF hIcon <> 0
    cBuffer = REPLICATE(CHR(0), ICONINFO_SIZE)
    = GetIconInfo(m.hIcon, @cBuffer)

    hbmMask = buf2dword(SUBSTR(cBuffer, 13,4))
    hbmColor = buf2dword(SUBSTR(cBuffer, 17,4))

    nResult = ImageList_Add(THIS.himl, hbmColor, hbmMask)

    = DestroyIcon(hIcon)
ENDIF
My comment:
The Usage shows how the image from an icon resource can be added to an Image List specified by its HIMAGELIST handle, THIS.himl.

See also: ImageList_Remove, ImageList_GetImageCount, LoadIcon, ExtractIcon, GetIconInfo, LoadImage
Word Index links for the ImageList_Add :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2007-05-24 18:35:47
Modified: 2007-06-11 20:01:21
Visited in last 7 days: 22
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.83.122.227)
9 sec.Function: 'DocumentProperties'
18 sec.Function: 'SetWindowRgn'
27 sec.Function: 'CryptDecrypt'
36 sec.Function: 'waveOutGetVolume'
46 sec.Function: 'CryptStringToBinary'
1 min.Function: 'GetRgnBox'
1.27 min.Function: 'SetUserGeoID'
1.52 min.Function: 'FtpOpenFile'
1.73 min.Function: 'GdipCreatePen1'
1.98 min.Function: 'HeapAlloc'
Google
Advertise here!