PDA

Click to See Complete Forum and Search --> : Image List Problem


davethebrat
Jul 23rd, 2001, 10:11 AM
I know I am making a supid mistake thats proably obvious. How do I get my extracted icon added to a image list? Please read 2nd last line in code for explanation >>>>


Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long

Function getREALicon()

Dim exename As String ' full filename of sol.exe
Dim hIcon As Long ' handle to the display icon
Dim retval As Long ' generic API function return value

exename = "c:\program files\real\realplayer\realplay.exe"

' Now, extract the first icon stored in RealPlayer program.
hIcon = ExtractIcon(App.hInstance, exename, 0)

' Below is what i tired but it comes back as type mismatch
frmMediaManager.ImageList1.ListImages.Add 1, 1, hIcon