PC Review


Reply
Thread Tools Rate Thread

Displaying icons for registered file types

 
 
Gwyn
Guest
Posts: n/a
 
      13th Dec 2003
Howdy. In my vb.net application I want to populate a
listview with a list of files but I also want to show the
icon for those files according to the registered file
types on the user's computer, e.g. if I list a file with
a .doc extension I want a pretty Word icon next to it....

But how do I populate a listview with the required icons?
Is there help in .NET to do this or do I need to search
the registry? If so, where???!!!!

Thanks in advance to anyone who can help!
 
Reply With Quote
 
 
 
 
nickp
Guest
Posts: n/a
 
      13th Dec 2003
Gwyn,
You will need to the System.Runtime.InteropServices namespace and P/Invoke some Win32 code, basically you will be calling SHGetFileInfo and using a SHFILEINFO structure. The following link provides an article for exactly what you are looking for. Hope this help.

http://www.codeguru.com/vb_misc/HowToUseVB.html

-Nick Parker

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
 
Reply With Quote
 
Guest
Posts: n/a
 
      14th Dec 2003
I suspected as much. Yuk! (trying to avoid native stuff).
But how do I get the correct files to retrieve the icon
from... I've tried looking in the registry to get the
default icon for extensions but I can't, for example, find
a path from the .doc key to the class id that has the
defaulticon key from where I can get the file to go look
in..

Thanks so far... any more would be great!

This is quite a common requirement... it should be
provided in the framework...

>-----Original Message-----
>Gwyn,
> You will need to the System.Runtime.InteropServices

namespace and P/Invoke some Win32 code, basically you will
be calling SHGetFileInfo and using a SHFILEINFO
structure. The following link provides an article for
exactly what you are looking for. Hope this help.
>
>http://www.codeguru.com/vb_misc/HowToUseVB.html
>
>-Nick Parker
>
>---
>Posted using Wimdows.net NntpNews Component - Posted

from .NET's Largest Community Website:
http://www.dotnetjunkies.com/newsgroups/
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
registered file types kb Windows XP Help 3 25th Jan 2005 07:18 PM
Registered File Types Len Windows XP Help 2 30th Dec 2004 10:32 PM
Registered File types multitask Microsoft Windows 2000 Terminal Server Applications 1 31st Mar 2004 08:56 PM
Registered File Types stever Microsoft Windows 2000 1 24th Sep 2003 01:20 PM
Creating Registered File Types Jim Hartsell Windows XP Basics 0 5th Aug 2003 05:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:26 AM.