PDA

View Full Version : Using long filenames with a file association


FrankLaFond
06-05-2002, 11:56 AM
I have used ModifyRegistryKey() to set up a file association between the file extension (.bcf) and our application (classpharmer.exe). In summary:

HKEY_CLASSES_ROOT\.bcf : Bioreason.File
HKEY_CLASSES_ROOT\Bioreason.File\shell\open\comman d : %AppDir%\classpharmer.exe "%1"
HKEY_CLASSES_ROOT\Bioreason.File\DefaultIcon : %AppDir%\classpharmer.exe,0

Everything works fine EXCEPT when I click on a file, the short (i.e. 8.3) name is used rather than the long name. Can anyone share some insight on how to get the application to launch using the long filename?

Thank you,
Frank LaFond

FrankLaFond
06-05-2002, 03:12 PM
I think I've got it. It turns out that %AppDir% is likely to have spaces in it (i.e. "Program <space> Files") and hence the:

%AppDir%\classpharmer.exe needs to have quotes around it as well as the %1. Once the extra quotes were added, long file names are used.

Frank.