April 19, 2024, 11:51:18 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Registering Filetypes

Started by ExMember001, November 24, 2006, 06:34:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ExMember001

Hi,
i've managed to get my program start playing when an audio file is double clicked in explorer...
but the icon is not retrieve from my program ressource.. (reboot just put icon to blank)

here is what i'm doing:
i've added an icon ressource as id 1

then i set the registry like that:

        ARegSetValue("HKEY_CLASSES_ROOT\\.mp1","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.mp2","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.mp3","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.ogg","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.flac","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.wma","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.aif","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.wav","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.cda","AmpKC");
ARegSetValue("HKEY_CLASSES_ROOT\\.m3u","AmpKC");

ARegSetValue("HKEY_CLASSES_ROOT\\AmpKC","AmpKC File");
ARegSetValue("HKEY_CLASSES_ROOT\\AmpKC\\DefaultIcon",Getstartpath()+"AmpKC.exe,1");
ARegSetValue("HKEY_CLASSES_ROOT\\AmpKC\\Shell","");
ARegSetValue("HKEY_CLASSES_ROOT\\AmpKC\\Shell\\open","");
ARegSetValue("HKEY_CLASSES_ROOT\\AmpKC\\Shell\\open\\command",Getstartpath()+"AmpKC.exe %1");


anyhone know why my icon is not set to the files ?

Steven Picard

This is good.  Thanks for sharing!

Ionic Wind Support Team

the ,1 isn't the ID of the icon.   It means the '1st icon' in the resource directory of the executable.

For your default icon, the one that you want to show up as the executables icon when viewed with the explorer, use the ID of 101.

Ionic Wind Support Team

ExMember001

ok, i've set the id to 101 in my program, now the icon show in the caption without setting it manually, great thanx :)

if the icon at id 101 is the only ressource i added so far, using AmpKC,1 in registry should work?
but it doesnt...

Ionic Wind Support Team

Should.  But I haven't had much luck myself with Windows icons.  Half the time they work like they should, the other half of the time I have to reboot many times.

I would verify with RegEdit that everything looks normal.  One thing I do rememember is if the path has spaces in it then it has to be converted to a short filename or the icon won't be picked up.  Try ,0 as well. 

The entry for the Mozilla browser shows this for the defaulticon setting:

C:\PROGRA~1\MOZILLA.ORG\MOZILLA\MOZILLA.EXE,0

Which is the short filename since "program files" has a space in it.  You could also try surrounding it with quotes.

Paul.
Ionic Wind Support Team

ExMember001

interresting, thanx ;)
i'll try the 0 and short filename.

ExMember001

using AmpKC,0 resolve it  :o
no reboot or shortfilename needed, thanx a lot  ;D

Ionic Wind Support Team

Sometimes you hit the target with a shotgun easier than a rifle ;)  In other words when all else fails try things at random.
Ionic Wind Support Team