Default System Icon

Just starting out? Need help? Post your questions and find answers here.
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Default System Icon

Post 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 ?
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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
quidquid Latine dictum sit altum videtur
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post 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
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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
quidquid Latine dictum sit altum videtur
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post 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.
Post Reply