I've made a program that searches for various file types and places their names along with other pieces of information in an MSFlexGrid control. To spice up the look of the grid, I decided I wanted to copy the small icon associated with a certain file type and add it to the grid. For example, here is my code to "steal" the small icon from the Windows calculator program...
FileName$ = "c:\windows\calc.exe"
hImgSmall& = SHGetFileInfo(FileName$, 0&, shinfo, Len(shinfo), BASIC_SHGFI_FLAGS Or SHGFI_SMALLICON)
r& = ImageList_Draw(hImgSmall&, shinfo.iIcon, Picture1.hDC, 0, 0, ILD_TRANSPARENT)
This code copies the small calculator icon to Picture1 without any problem. The problem is, I can't do anything with the icon once I get it to Picture1. The code to normally set an icon in the MSFlexGrid is as follows:
Set MSFlexGrid1.CellPicture = Picture1.Picture
However, this doesn't work in my scenario! The API doesn't actually put the copied icon into the "picture" property of Picture1. Does anyone know how I can get this copied icon into the list box. I'm not too familiar with the graphics API... all I know is that everything I've tried so far hasn't work. Thanks for any help you can provide.
Chaz
[email protected]
