473,406 Members | 2,847 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,406 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 1726
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.