473,498 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get the Symbol/Icon associated with a file or directory name

Hi,

I want to programm some kind of Explorer like the Windows Explorer.
And I want to know how can i get the same Icons/Symbols for the files and
directories like the Windows Explorer uses.

Example:

The Icon for the Desktop.

With the Command:
Environment.GetFolderPath(Environment.SpecialFolde r.Desktop)
I can get the folder where the Windows Desktop is located.

But how can I get the standart icon for the desktop?
Nov 16 '05 #1
2 1995
Unfortunately, I think you will need to use Win32 API for that.
In shell32.dll there is SHGetFileInfo.

--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Alexander Keßler" <al**************@gmx.net> wrote in message
news:ck**********@news.uni-kl.de...
Hi,

I want to programm some kind of Explorer like the Windows Explorer.
And I want to know how can i get the same Icons/Symbols for the files and
directories like the Windows Explorer uses.

Example:

The Icon for the Desktop.

With the Command:
Environment.GetFolderPath(Environment.SpecialFolde r.Desktop)
I can get the folder where the Windows Desktop is located.

But how can I get the standart icon for the desktop?

Nov 16 '05 #2
"Alexander Keßler" <al**************@gmx.net> wrote in message
news:ck**********@news.uni-kl.de...
Hi,

I want to programm some kind of Explorer like the Windows Explorer.
And I want to know how can i get the same Icons/Symbols for the files and
directories like the Windows Explorer uses.

Example:

The Icon for the Desktop.

With the Command:
Environment.GetFolderPath(Environment.SpecialFolde r.Desktop)
I can get the folder where the Windows Desktop is located.

But how can I get the standart icon for the desktop?

Hello Alexander,

You'll have to use WinApi's SHGetFileInfo method. Check these:

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

http://www.codeguru.com/Csharp/Cshar...cle.php/c4261/

Note that for retrieving icons for individual files, it is much faster to
use filename extension since it will fetch icons from the shell icon cache.

HTH.

Regards,

Julijan
Nov 16 '05 #3

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

Similar topics

11
13073
by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal...
8
2857
by: Ed Isenberg | last post by:
I notice that a lot of Web pages have an icon that is displayed preceding the URL in the place in the browser where the URL is displayed. When I bookmark or add this to Favorites the icon is also...
7
7292
by: Alexander Keßler | last post by:
Hi, I asked u this morning: --------------------------------------- I want to programm some kind of Explorer like the Windows Explorer. And I want to know how can i get the same Icons/Symbols...
5
2533
by: Anders K. Olsen | last post by:
Hello group I'm developing a file application, but I have run into a problem that I hope you can help with. My application lists a number of files (names). Now I would like to display the...
8
1477
by: Dinesh Jain | last post by:
Hi al,, I have written a code which displays directory listing of files from FTP server directory.I display all the files in a listview with its associated icons. To display icons, I get the...
4
3814
by: techspirit | last post by:
Hi all, 1) I found out from the vb.net group that it is possible to get an associated icon for a file. My requirement is to display all programs from the Start Menu for the user along with the...
4
8201
by: Sin Jeong-hun | last post by:
I already found that I have to use SHGetFileInfo to get the System's associated icon with that file. But what about I just want to get associated icon for some specific extensions? For example,...
2
5298
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
5
6664
by: =?Utf-8?B?TG9hbldvbGY=?= | last post by:
I'm working on a Windows Explorer-like application. What is the best way to find out what application is set to open a particular type of file? Is there a function to do this? Do I have to go...
0
7167
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
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6890
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
5464
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,...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
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
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
292
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.