Results 1 to 3 of 3

Thread: Adding image to a listview at runtime from the icon extracted from a file?

  1. #1

    Thread Starter
    Addicted Member mandark's Avatar
    Join Date
    Oct 2002
    Posts
    188

    Question 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.

  2. #2

    Thread Starter
    Addicted Member mandark's Avatar
    Join Date
    Oct 2002
    Posts
    188
    bump!!!


  3. #3
    Addicted Member
    Join Date
    Mar 2001
    Location
    Greece
    Posts
    164
    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
  •  



Click Here to Expand Forum to Full Width