473,473 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

File type icons

Hopefully this is a simple enough question...

Is there a way to find the default icon for a particular file extension
(.TXT, .DOC, .CPP, etc)? Similarly, how can you access the default icon used
for folders?

Thanks in advance.

Nov 16 '05 #1
3 2021
Hi,

AFAIK the only way to retreive this information is to use SHGetFileInfo(a
shell function). I have posted a article to a breif tutorial on how to use
it below.

I hope this helps.
------------------------
http://www.codeguru.com/Csharp/Cshar...cle.php/c4261/

http://msdn.microsoft.com/library/de...etfileinfo.asp

http://www.pinvoke.net

Nov 16 '05 #2
Thanks for the link, it should help. The only problem is that you seem to
have to provide a valid file location rather than just a file extension. I
guess I'll be able to create a temporary file and extract the icon from that
but it still seems a little unnecessary. For the record, I'm not particularly
interested in whether (for example) an EXE file has a custom icon.

Thanks again

"Brian Brown" wrote:
Hi,

AFAIK the only way to retreive this information is to use SHGetFileInfo(a
shell function). I have posted a article to a breif tutorial on how to use
it below.

I hope this helps.
------------------------
http://www.codeguru.com/Csharp/Cshar...cle.php/c4261/

http://msdn.microsoft.com/library/de...etfileinfo.asp

http://www.pinvoke.net

Nov 16 '05 #3
Thanks for the link, it should help. The only problem is that you seem to
have to provide a valid file location rather than just a file extension.


Not if you specify the SHGFI_USEFILEATTRIBUTES flag. See

http://support.microsoft.com/?kbid=179167


Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #4

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

Similar topics

5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
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: DraguVaso | last post by:
Hi, In my application I need to list some files (a little bit like in windows explorer), and I wan't to show next to each file the right Icon, as used in windows explorer. how can i find which...
4
by: redneon | last post by:
I've written a simple application which connects to an FTP server and recursively lists the contents of the directories in this server in a ListBox. What I'm wanting to do is change the ListBox and...
1
by: Víctor | last post by:
I'm doing a kind of file explorer with some additional funcionalities. The problem is that I'm not able to draw file extension icons in a ListView. I know how obtain icons, but when I try to draw...
2
by: Brian Henry | last post by:
I want to list out a directory listing along with showing the file type name (like explorer does when it says something like "MyDoc.DOC - Microsoft Word Document" How do I get that file type name...
8
by: neoedmund | last post by:
any simple method?
2
by: Peter | last post by:
Hello, Is there a way to, after creating a binary (or other kind of) file using a FileStream object, to set its icon in Windows?
1
by: John | last post by:
Is there such a thing as storing icons or bitmaps into a resource file, and adding more icons or bitmaps into the resource file at runtime? I want to store a bunch of icons into a resource file,...
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...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.