|
-
Jun 27th, 2003, 09:47 AM
#1
Thread Starter
Addicted Member
Adding image to a listview at runtime from the icon extracted from a file?
Hi,
I want to populate a listview with files list, where the icons of the respective file would be displayed.
For example, if the file listed in listview is an application, the icon related with the application need to be displayed.
Cheers.
-
Jul 1st, 2003, 10:23 AM
#2
Thread Starter
Addicted Member
-
Jul 1st, 2003, 02:11 PM
#3
Addicted Member
Use the ExtractIcon function which retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file.
Definition :
Code:
Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Parameters:
· hInst
Identifies the instance of the application calling the function.
· lpszExeFileName
Points to a null-terminated string specifying the name of an executable file, DLL, or icon file.
· nIconIndex
Specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If this value is -1, the function returns the total number of icons in the specified file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|