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. Visual Basic
  4. VB.Net Thumbnail For File Based On Contents, Associate File With Program

VB.Net Thumbnail For File Based On Contents, Associate File With Program

Scheduled Pinned Locked Moved Visual Basic
csharphardwarehelptutorial
4 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.
  • C Offline
    C Offline
    Codemonkey85
    wrote on last edited by
    #1

    Hello, I am creating a program in VB.Net that reads data from a specific file type (one that I didn't create). Part of my program reads the file to determine some of the data in it, references an embedded resource image (choosing which image based on said data), and displays that image in a picturebox. I would like for these files to display a thumbnail of that same image in Explorer. I'd be all right with an explorer-like interface in my program that does this, but I'd much prefer if it could be applied to Explorer, so I can see these thumbnails even without the program running. I've looked for information on how to do this everywhere, and I can't find any. In a similar vein, I would like to associate these files with my program, so that when I double click them, my program launches and knows what to do with that file (basically it would run the functions it runs now, only without the need for an openfiledialog). Any help (or points in the right direction at least) would be really appreciated. Thanks everyone!

    As I sit here, I contemplate the last words of Socrates: "I drank what?". Pokémon Pearl Friend Code: 4554-2418-6836

    D 1 Reply Last reply
    0
    • C Codemonkey85

      Hello, I am creating a program in VB.Net that reads data from a specific file type (one that I didn't create). Part of my program reads the file to determine some of the data in it, references an embedded resource image (choosing which image based on said data), and displays that image in a picturebox. I would like for these files to display a thumbnail of that same image in Explorer. I'd be all right with an explorer-like interface in my program that does this, but I'd much prefer if it could be applied to Explorer, so I can see these thumbnails even without the program running. I've looked for information on how to do this everywhere, and I can't find any. In a similar vein, I would like to associate these files with my program, so that when I double click them, my program launches and knows what to do with that file (basically it would run the functions it runs now, only without the need for an openfiledialog). Any help (or points in the right direction at least) would be really appreciated. Thanks everyone!

      As I sit here, I contemplate the last words of Socrates: "I drank what?". Pokémon Pearl Friend Code: 4554-2418-6836

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Associating the file extension is easy. You just have to go into Explorer >> Tools >> Options >> File Types tab >> New button. THen type in your file extension and click OK. When you get back to the list, click on your file extension, then click on Change. Click on the Browse button and file your application. That's a start anyway. You might have to tweak the final result for your requirements. Writing a Shell Extension, on the other hand, isn't so easy. It is highly recommended that you do NOT do this in any managed language (C#, VB.NET, ...) but instead, write it in plain Visual C++. But, you can read up a bit on it at http://msdn.microsoft.com/en-us/magazine/cc188741.aspx[^] If you're not familiar with Shell internals, I suggest postponing this project until you do a ton of research on the topic. You can start here[^]. This was the first in a series of three articles on the subject.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      C 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Associating the file extension is easy. You just have to go into Explorer >> Tools >> Options >> File Types tab >> New button. THen type in your file extension and click OK. When you get back to the list, click on your file extension, then click on Change. Click on the Browse button and file your application. That's a start anyway. You might have to tweak the final result for your requirements. Writing a Shell Extension, on the other hand, isn't so easy. It is highly recommended that you do NOT do this in any managed language (C#, VB.NET, ...) but instead, write it in plain Visual C++. But, you can read up a bit on it at http://msdn.microsoft.com/en-us/magazine/cc188741.aspx[^] If you're not familiar with Shell internals, I suggest postponing this project until you do a ton of research on the topic. You can start here[^]. This was the first in a series of three articles on the subject.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        C Offline
        C Offline
        Codemonkey85
        wrote on last edited by
        #3

        The file association has to be done programmatically, for deployment purposes... although that method would be fine for my personal use (if I could then figure out how to set my program to know what to do once the file is opened in this fashion). I'll look into those links you provided. I may be in over my head, but something tells me someone else has tried something like this. Thanks!

        As I sit here, I contemplate the last words of Socrates: "I drank what?". Pokémon Pearl Friend Code: 4554-2418-6836

        D 1 Reply Last reply
        0
        • C Codemonkey85

          The file association has to be done programmatically, for deployment purposes... although that method would be fine for my personal use (if I could then figure out how to set my program to know what to do once the file is opened in this fashion). I'll look into those links you provided. I may be in over my head, but something tells me someone else has tried something like this. Thanks!

          As I sit here, I contemplate the last words of Socrates: "I drank what?". Pokémon Pearl Friend Code: 4554-2418-6836

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          CodeMonkey85 wrote:

          The file association has to be done programmatically, for deployment purposes... although that method would be fine for my personal use (if I could then figure out how to set my program to know what to do once the file is opened in this fashion).

          Get the association to work in your dev environment first. Then you can look in the Registry, under HKEY_CLASSES_ROOT to show you what you have to reproduce in your installation code to do it. As for the image preview in Explorer, yes, other people have done it, and that's what they had to go through to accomplish it. There is no "template" project where you just modify a little bit of code, compile it call it Done!

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          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