The issue with .txts on your system may be because the txt extension isn't fully registered. Meaning that it's set to open with a certain program but isn't assigned an icon (and usually a meaningful description), ie the DefaultIcon key is missing but the shell\open\command one exists. In this case, Windows assing its own icon to the file type; that icon is a white piece of paper with the main icon of the application used to open this type "printed" on its center (in smaller size). Does the displayed icon for .txts on your system look like this?
Ufortunately, since this type of icon is generated by Windows and does not reside anywhere, scripts cannot use it (at least without a dll written specifically for that).
On a sidenote, and this is for the OP, certain file types (like .exe, .ico, .cur etc) use their own icon. In these cases, the DefaultIcon entry in the registry is "%1". %1 is a sort of variable, returning the full path of the file with the extension in question. So, if $get_ft_icon(ext) returns "%1", the script should use the path of a file with that extension (for example, using $findfile(\,*.ext,1)).
Edit: Actually, in case of txts, the app-icon-on-white-page icon isn't used because there already is an icon that looks like a text page in shell32.dll. Apparently, Windows has a (short, I suppose) internal list of default icons for certain extensions.
Last edited by qwerty; 19/10/04 04:54 PM.