No, they are not all Executables. One program launches the code below to create a file extention, (like *.txt, except this extention is *.xxx) When the program creates the extention, then any file with *.xxx will be associated with my program. The problem is that the icon for the new file extention is the same as the executable.
the files with extentions of *.xxx are simple flat files, used as scripts within the executable itself. I want them to have their own icon.
When a user sees the flat file, he thinks that it is the executable, because the icon for *.xxx and *.exe are the same. He opens the flat file and gets frusterated because it's not the executable. I'm not trying to change the icon for the executable, just the files with the *.xxx extention. I know I need to add a key in the registry to make the icon different, but for some reason what I'm doing is just not right.
Here is my code. I've removed some unimportant parts, but the part Im having a problem with is highlighted. Maybe this will make my motives more clear.
//----------------------------------------------------------
#include <registry.hpp>
//----------------------------------------------------------
void ExtMak()
{
/* Register the file extension */
/* Create a new instance of the Registry class */
TRegistry* thisReg = new TRegistry();
/* Set the root key to HKEY_CLASSES_ROOT, which is where file associations are stored */
thisReg->RootKey = HKEY_CLASSES_ROOT;
/* Create the key for the file extension you want to register */
/* this is where the file extention is defined */
thisReg->OpenKey(
"*.xxx", true);
/* Set the default value to the program you want to associate the extension with */
thisReg->WriteString("", "FormLoader"

;
/* Close Key */
thisReg->CloseKey();
-unimportant code removed here-
/* Set default icon */
/* This is the icon that will be given each object/file that has user defined extension */
thisReg->OpenKey("FormLoader", true);
thisReg->OpenKey("DefaultIcon", true);
/* sets icon of the extention to the same icon as the executable */
thisReg->WriteString("", ParamStr(0)+",0"
;
/* Clean up */
delete thisReg;
return;
}
//----------------------------------------------------------
the way I see it, if I put the location of the desired icon in place of DefaultIcon (located within the highlighted code,) then it the icon should be stuck to the extention, but it doesn't seem to work. Cyprus