Hi,
I am writing a program launcher (in Delphi) to start a 3rd party app which looks for data on 2 CDs. Rather than ask the end-user to insert and switch between the CDs, I thought I’d try to copy ISO files to the HDD, use WinCDEmu to programmatically create virtual CD drives and fudge the target app to look in the new CD drives for the data. Result for the end-user should be that double-clicking the launcher icon apparently ‘just’ starts the 3rd party app which gets its data from the HDD. No (physical) CDs needed.
Doing this manually works a treat. (Fudging the 3rd party app just needs to edit the INI file with the new drive letters).
Doing it programmaticaly gives me a couple of problems. The main one is knowing when the new virtual drive is ready for use. I’ve tried a few half-baked ideas (e.g. putting the launcher to sleep for a few seconds; putting it into a loop while checking the list of available drives and waking it up when the list changes) but what would be ideal would be to catch a Windows message which signals either that the drive is ready for use, or has been destroyed.
And just to add cream to the cake, the successful completion message could also return the newly assigned drive letter.
My other problem is that I am using the “QueryCancelAutoPlay” Windows message to suppress the Autoplay function after the CD drive is created. This works fine for the first drive that WinCDEmu creates, but doesn’t work for the second – in fact the second drive always opens a folder to view files instead of displaying the standard ‘What do you want to do?’ autoplay dialog. Any ideas?
I’ve used the Windows API before but I am no expert (to say the least) so any suggestions about which API function I could use (if any exist to do this) would be most welcome. Thanks.