Sign in to follow this  
Followers 0
eXirrah

How to get file current icon

7 posts in this topic

A feature in a program I create is that it shows the files assosiated with icons as shown in Windows Explorer.

The problem is that I can't find a way to determine which icon is an executable file using.

For other file extentions than .exe I search in the registry.

Example: for .txt files one can find the icon by following these steps (WinXP - I never tested that on any other windows)

Read HEKY_CLASSES_ROOT\.txt\(Default)

Search for HTKEY_CLASSES_ROO\<Read>\DefaultIcon\(Default)

You should get a comma separated string which tells you where the icon that .txt files use can be found.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

I need an algorithm that can tell me where I can find the icon assiciated with a file in windows explorer.

Can this be done?

If it can point me in the right direction please.

I was explaining how I was able to find the icons of some of the file extentions.

I need algorithms like that for all the other file types like:

1) executables

2) files that have icons generated by Windows.

Edited by eXirrah

Share this post


Link to post
Share on other sites

Can this be done?

Yes.

Point me in the right direction.

Just use search. It's been asked before and before, and before that, and before that .. and before ... and before ......

http://www.autoitscript.com/forum/index.php?showtopic=105984

http://www.autoitscript.com/forum/index.php?showtopic=105802

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/forum/index.php?showtopic=105984

Close :), my thread above is just about extracting the Typename per file...

Take a look at the _WinAPI_ShellGetFileInfo() function in Yashieds excellent WinAPIEx.au3 UDF.

Share this post


Link to post
Share on other sites

Close :), my thread above is just about extracting the Typename per file...

Take a look at the _WinAPI_ShellGetFileInfo() function in Yashieds excellent WinAPIEx.au3 UDF.

I'm not really going to invest a lot of time in finding a topic for someone, because they don't invest a lot of time themselves. Usually I just copy the first two results so that people realize they're being stupid for not having searched enough.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

This is because I already checked these threads and instead of wasting your time in reading

the probably at least 50 thread I read the last 2 hours at the forums I decided not to discuss it.

FileGetShortcut() - I don't need shortcut icons... I need the eecutable icons.

A similar algorithm to KaFu's I already posted in the first post.

EDIT: I am sure that the icon index and the filename of the file containing the icon are written somewhere

in the executable file.

I am sure that there is AutoIt function(at least not in the standart package) that returns this information.

My main question is: How can I read from an executable the location of it's icon and it's index.

Edited by eXirrah

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0