Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Icons

Icons

Scheduled Pinned Locked Moved C#
databasewinformshelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sean89
    wrote on last edited by
    #1

    I have a database in which users can upload files for storage and whatnot. In my windows forms app to download/upload I am displaying the files that the user has uploaded. In the ListView I would like to display the appropriate icon for each file. ex: If they have Microsoft Word installed, it should display a Microsoft Word icon. If not just a plain file icon should be displayed. How would I do this? Any help is appreciated.

    RaviBeeR 1 Reply Last reply
    0
    • S Sean89

      I have a database in which users can upload files for storage and whatnot. In my windows forms app to download/upload I am displaying the files that the user has uploaded. In the ListView I would like to display the appropriate icon for each file. ex: If they have Microsoft Word installed, it should display a Microsoft Word icon. If not just a plain file icon should be displayed. How would I do this? Any help is appreciated.

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      Perhaps you could call SHGetFileInfo to obtain the file's icon index in the system image list (as well as its display name, eg: "Microsoft Word document"). You can pass a fictitious filename (with a matching extension) to SHGetFileInfo. See this[^] link for how to call ShGetFileInfo from your WinForms app. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      S 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        Perhaps you could call SHGetFileInfo to obtain the file's icon index in the system image list (as well as its display name, eg: "Microsoft Word document"). You can pass a fictitious filename (with a matching extension) to SHGetFileInfo. See this[^] link for how to call ShGetFileInfo from your WinForms app. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        S Offline
        S Offline
        Sean89
        wrote on last edited by
        #3

        Looks like that is what I need. Thanks!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups