Results 1 to 6 of 6

Thread: [RESOVED] Thumbnail Images for Files

  1. #1

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    [RESOVED] Thumbnail Images for Files

    Is it possible to set the image windows displays when viewing a file created in a VB.NET application?

    In my case I have files saved that store info on football plays for a play creator program. Can I use the image of that play as what the user will see when he searches through windows explorer?

    Let me further explain with an analogy: photo files in windows have their images displayed as the user cycles through them; he chooses which one he wants to doubleclick based on the thumbnail image of the actual photo. I'd like to have a "photo" of the play itself shown instead of what is now just a blank generic grey icon for the play files that I save.

    Does that make sense enough?
    Last edited by neef; Aug 7th, 2009 at 09:12 AM.
    Intermediate Level Programmer Extraordinaire

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Thumbnail Images for Files

    I think that that functionality is built into the OS itself for specific file types that it recognises, i.e. MS programmed it to recognise. For instance, Windows 7 uses the first page of a PDF as the icon. I don't think it works that way in Vista for PDFs.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Thumbnail Images for Files

    Just FYI, Vista does give the first page as the icon, for PDFs, if you are in Tiles, Medium Icons, Large Icons or Extra Large Icons mode. Just not in List, Details or Small icons.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

  4. #4

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    Re: Thumbnail Images for Files

    Thank you both for the info.
    Intermediate Level Programmer Extraordinaire

  5. #5
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [RESOVED] Thumbnail Images for Files

    Actually, I think you can do some of it. I think what you are looking for are Managed Preview Handlers:

    http://msdn.microsoft.com/en-us/magazine/cc163487.aspx

    I have never written one myself, but I think it will do what you want.

    EDIT: After reading a bit more, it doesn't change the icon, but when you click on a file, it does give you a preview, which may get you closer to what you want.
    Last edited by Negative0; Aug 7th, 2009 at 01:30 PM.

  6. #6
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [RESOVED] Thumbnail Images for Files

    This topic intrigued me, so I did a bit more digging. To do exactly what you wanted, you would have to write an Icon Handler shell extension. This is not something you should do in .Net and would require some C++ code to do. If anyone is interested in the future, here is a good link.

    http://www.codeproject.com/KB/shell/shellextguide9.aspx

    I always wondered how visual studio displayed which version of VS applied to a solution file, I am guessing this is how they did it.

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