>>You can associate a different icon with all files of a give type, but there's nothing available to tell Windows to look for a resource header AFAIK. You can see this if you go into Windows Explorer/View/Folder Options, select the File Types tab, pick a file type, and click the edit button - you can assign the icon to use for the file type there.
>
>OK, *now* you've done it. I have to ask another question - how can I do that programatically from within VFP?
It's a regitry entry under HKEY_CLASSES_ROOT\.
file extension, so for an .APP, examine the HKEY_CLASSES_ROOT\.APP tree, the default will give you the full ProgID of a COM object (in this case on my system, Visual.FoxPro.Application.6
Navigate to HKEY_CLASSES_ROOT\
Full ProgID. You'll find a subkey called DefaultIcon, a REG_SZ (string, consisting of a fully qualified path to the icon provider, and a 0 referenced icon table entry for that file.
In my case:
HKEY_CLASSES_ROOT\Visual.FoxPro.Application.6\DefaultIcon has the value:
c:\program files\microsoft visual studio\vfp98\vfp6.exe,0
which is the FoxHead.
Aren't you glad you asked?
The bad news is that anything that points to this ProgID shares the DefaultIcon.
The .FXP extension points to Visual.FoxPro.Compiled.Program, whose DefaultIcon is:
c:\program files\microsoft visual studio\vfp98\vfp6.exe,-102
You'll note that there are not -102 entries; I think (I'm not sure) that the range of entries is 0 - 127, and beyond that it's treated as a signed 1 byte value. I don't have all the details on the icon resource at hand.