Page 1 of 1

Default System Icon

Posted: Mon Jul 07, 2003 11:03 am
by Inner
Hi, just wondering if anyone knew how to obtain the default file type icon for a file name.. i.e

foo.jpg - has a icon defined by the user which exists in the file types tab, is there anyway of accessing this infomation ?

Posted: Mon Jul 07, 2003 11:42 pm
by freak
You asked a similar question some time ago... and got an answer :idea: :wink:

viewtopic.php?t=6352&highlight=

Just use this code, and use an existing file instead of the directory name,
and voila, you get it's icon.

Timo

Posted: Tue Jul 08, 2003 3:10 am
by Inner
indeed, I did. except it's not the same icon because file doesn't exist except for "foo.[insert ext here]" as a string in a config file.

alternatively, I suppose I could scan the catalog file for all the diferent extenshions and make a file of that type in a cache folder I suppose.
but that'd be resourceful I would have thought.

Unless that is exactally how you do it. :o

Posted: Tue Jul 08, 2003 12:44 pm
by freak
Hmm, that makes it a bit more complicated, as the code I posted
only works with existing files/folders.

You can also try to find the info you need in the Registry. But that's a bit
more of work.

pcfreak from the PB chat once had a working example for that, but he is
on vacation till next week, Maybe he can give it to you when he's back.

Timo

Posted: Tue Jul 08, 2003 3:26 pm
by Inner
Thanks Freak, I'll contact him in a week when he returns, until the I'll use the current implymentation :) which basically exports a 0 byte file as the extension name to disk and then grabs the icon from it.
thanks again.