473,385 Members | 1,942 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,385 software developers and data experts.

Get icon of extension

Hello,

what is the best way to get an icon of an extension WITHOUT actually having
a file?

For example I want the icon of a acrobat document.
Then I can search for a pdf file on my harddisk and use this file for
extracting the icon.
But this can take a long time perhaps.

Doesn't there exist a more direct approach?

Thanks
Nov 20 '05 #1
2 5249
what is the best way to get an icon of an extension WITHOUT actually having
a file?


Use the SHGetFileInfo Win32 API function with the flag
SHGFI_USEFILEATTRIBUTES.

How To Retrieve an Icon for a File Class Without a File
http://support.microsoft.com/?kbid=179167

How to use the SHGetFileInfo function to get the icons that are
associated with files in Visual Basic .NET
http://support.microsoft.com/?kbid=319340

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 20 '05 #2
Thanks a lot!
just what I needed.

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
what is the best way to get an icon of an extension WITHOUT actually havinga file?


Use the SHGetFileInfo Win32 API function with the flag
SHGFI_USEFILEATTRIBUTES.

How To Retrieve an Icon for a File Class Without a File
http://support.microsoft.com/?kbid=179167

How to use the SHGetFileInfo function to get the icons that are
associated with files in Visual Basic .NET
http://support.microsoft.com/?kbid=319340

Mattias

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

Nov 20 '05 #3

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

Similar topics

8
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...
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...
7
by: Shane Story | last post by:
I want to be able to get the icon associated with a certain file extension. I can read the registry hkey_classes to get the ext. then look to the other key for default icon. How can I then...
5
by: IcingDeath via DotNetMonster.com | last post by:
I am building this SQL Server database app in which i can store files. In order to display files I want to have the app show the associated icon for the extension of the file that is in the...
13
by: Lou | last post by:
if I add a new item (Solution Items) to my project and its an icon(.ico), how can I reference that file when I am coding, Do I have to also add it to an image control, I don't want the file to be...
3
by: Peter Rilling | last post by:
When I installed VS.NET, I noticed that the solution files (having the extension .sln) seem to know what version of the ide created it. If I have previous version, the icon changes and when...
1
by: Neo | last post by:
please tell me, how get icon structure associated with extension? if my file extention is (Doc) then how and where i get icon of document file? regards, Mohammad Omer Nasir
2
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
Hi; How can I set the icon for the DLL file a portla deploy project creates? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars -...
2
by: Matt | last post by:
How do I get a Icon for display in a list view from just the file extension? If I have a file that exists on a local machine I can use Icon.ExtractAssociatedIcon, but in this case the files are...
5
by: AGP | last post by:
I have been looking far and wide for an easy to implement shell extension. My needs are basic...for two file extensions .YYY and .ZZZ I would like the context menu in explorer to simply show my app...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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,...

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.