Anonymous
10-14-1999, 01:12 AM
I've written an application that I'd like to take advantage of the Window's shell's file-association capability. I've added entries to the registry to allow me to add verbs to the context menus, and as long as I stick to non-DDE entries, I'm fine.
However, when I try and add DDE hooks to run my application, I come upon an odd problem I just don't know how to get around. If my application is not running, and I launch a file associated with my application via the shell, the shell (and not my application) will throw up the message:
Cannot find the file 'C:\Directory\File.ext' (or one of its components). Make sure the path and filename are correct and that all required libraries are available.
However, even as the error message is displayed, my application continues to properly load and utilize the file.
If I start the application myself and load the file, or if the application is already running when I launch an association, I do not get an error message, and everything works just fine.
Additionally, if I remove the DDEEXEC entry, I no longer encounter this problem. However, its VERY important that my application include the DDE hook, as I expect the user to launch LARGE numbers associated files from Explorer at a time. I've experimented, and the drain on the system is prohibitively high if I allow the shell to launch a copy of my application for each associated file run and have the multiple copies communicate back and forth to consolidate the list of launched files in a single application.
Any idea what I'm doing wrong? I've combed MSDN and searched for quite some time for any info on this sort of thing, but none of the resources I've found seem to talk much on how to do the DDEXEC stuff.
Below is a dump of the registry entries I've added.
I'd appreciate ANY help anyone could give me on this. Thanks.
Irfaan Chaudhry
www.welcome.to/pompous
p.s. If it helps any, the application I'm writing is a media player I've written in VB that's kinda like Nullsoft's WinAmp, which is why I expect so many associations to run at a time.
=================================================
[HKEY_CLASSES_ROOT\SlimAmp.File]
@="Slimamp Media File"
"EditFlags"=hex:00,00,00,00
[HKEY_CLASSES_ROOT\SlimAmp.File\shell]
@="Enqueue&/Play"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play]
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play\command]
@="\"C:\\PROGRAM FILES\\LITTLE PROGRAMS\\SLIMAMP.exe\" /play \"%1\""
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play\ddeexec]
@="/play %1"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play\ddeexec\ Application]
@="SlimAmp"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play\ddeexec\ Topic]
@="SACommand"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue]
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue\comma nd]
@="\"C:\\PROGRAM FILES\\LITTLE PROGRAMS\\SLIMAMP.exe\" /enqueue \"%1\""
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue\ddeex ec]
@="/enqueue %1"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue\ddeex ec\Application]
@="SlimAmp"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue\ddeex ec\Topic]
@="SACommand"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play]
"EditFlags"=hex:01,00,00,00
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play\command]
@="\"C:\\PROGRAM FILES\\LITTLE PROGRAMS\\SLIMAMP.exe\" /enqueueandplay \"%1\""
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play\ddeexec]
@="/enqueueandplay(%1)"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play\ddeexec\Application]
@="SlimAmp"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play\ddeexec\Topic]
@="SACommand"
However, when I try and add DDE hooks to run my application, I come upon an odd problem I just don't know how to get around. If my application is not running, and I launch a file associated with my application via the shell, the shell (and not my application) will throw up the message:
Cannot find the file 'C:\Directory\File.ext' (or one of its components). Make sure the path and filename are correct and that all required libraries are available.
However, even as the error message is displayed, my application continues to properly load and utilize the file.
If I start the application myself and load the file, or if the application is already running when I launch an association, I do not get an error message, and everything works just fine.
Additionally, if I remove the DDEEXEC entry, I no longer encounter this problem. However, its VERY important that my application include the DDE hook, as I expect the user to launch LARGE numbers associated files from Explorer at a time. I've experimented, and the drain on the system is prohibitively high if I allow the shell to launch a copy of my application for each associated file run and have the multiple copies communicate back and forth to consolidate the list of launched files in a single application.
Any idea what I'm doing wrong? I've combed MSDN and searched for quite some time for any info on this sort of thing, but none of the resources I've found seem to talk much on how to do the DDEXEC stuff.
Below is a dump of the registry entries I've added.
I'd appreciate ANY help anyone could give me on this. Thanks.
Irfaan Chaudhry
www.welcome.to/pompous
p.s. If it helps any, the application I'm writing is a media player I've written in VB that's kinda like Nullsoft's WinAmp, which is why I expect so many associations to run at a time.
=================================================
[HKEY_CLASSES_ROOT\SlimAmp.File]
@="Slimamp Media File"
"EditFlags"=hex:00,00,00,00
[HKEY_CLASSES_ROOT\SlimAmp.File\shell]
@="Enqueue&/Play"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play]
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play\command]
@="\"C:\\PROGRAM FILES\\LITTLE PROGRAMS\\SLIMAMP.exe\" /play \"%1\""
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play\ddeexec]
@="/play %1"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play\ddeexec\ Application]
@="SlimAmp"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Play\ddeexec\ Topic]
@="SACommand"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue]
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue\comma nd]
@="\"C:\\PROGRAM FILES\\LITTLE PROGRAMS\\SLIMAMP.exe\" /enqueue \"%1\""
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue\ddeex ec]
@="/enqueue %1"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue\ddeex ec\Application]
@="SlimAmp"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue\ddeex ec\Topic]
@="SACommand"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play]
"EditFlags"=hex:01,00,00,00
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play\command]
@="\"C:\\PROGRAM FILES\\LITTLE PROGRAMS\\SLIMAMP.exe\" /enqueueandplay \"%1\""
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play\ddeexec]
@="/enqueueandplay(%1)"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play\ddeexec\Application]
@="SlimAmp"
[HKEY_CLASSES_ROOT\SlimAmp.File\shell\Enqueue&/Play\ddeexec\Topic]
@="SACommand"