473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Displaying icons for registered file types

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!
Nov 22 '05 #1
2 1723
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/
Nov 22 '05 #2
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/.

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jakob Bengtsson | last post by:
Hi, Does anyone know how to get the icons for all filetypes installed on the system? I can extract the associated icon from a file, but I don't know how to: 1) Get a list of filetypes; 2) Get...
5
by: Eric | last post by:
I want to use embedded icon resources for my file type associations, but only the app.ico seems to show up when I go to choose the icons in the setup File Types editor. The same thing when I try...
2
by: Gwyn | last post by:
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,...
3
by: Ron Vecchi | last post by:
I'm trying to get a list of all file icons registered to file extensions located on the machine. I would like to beable to loop through all icons and save the images in a seperate directory named...
8
by: Jon Weston | last post by:
I'm setting up an Access2003 database with pictures. I put a bound ole picture ctrl on a form that's source is the table that contains the pictures and follow ALL the directions for embedding a...
1
by: Henrik | last post by:
I'm sorry to trouble you once again but somebody must know how to get a list of the desktop icons and their respective positions. I know that I have to look into shell but I have no idea how to...
1
by: Rich | last post by:
Hello, I have created icons before with icon editor that comes with VS2003 without any issues. Today I created another icon for my VB.Net app. But this .ico file is not displaying the figure...
3
by: suvarnask1 | last post by:
Any one can help MEEEE .....WIndows 2000-Desktop icons not Displaying In My System After Booting process display one message "Userenv.dll is missing" after click on that not displaying the desktop...
2
by: kelvin.koogan | last post by:
I want to dynamically change the icon displayed in a status bar panel. I've created the icons in the resource file, app.rc, e.g. IDI_MYICON. How can I load this icon and display it in the...
2
by: Ashutosh | last post by:
Hi, I am trying to include icons in my .net exe so that I can select those icons for the shell, like setting the icons of shortcuts, icons for some file types, etc... I tried to include the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.