Quoting Alistair George <[EMAIL PROTECTED]>:

> I know how to associate filetypes and link them in the registry, and pass
> command parameters to Delphi, but how do you pass the same parameters to
> myapp once it is running eg if a graphics program, say I click an associate
> item, it opens OK with that, now I click another associate item, but I want
> Windoze to pass the new graphic to my open program and use that as a new
> image. Do I have to do a timer loop or something to keep checking for a new
> incoming paramstr?

What you are doing in effect is exchanging information between programs. What 
will happen by default in Explorer is that it will try to start another 
instance of your application and pass the commandline parameters to that new 
instance. If your application has a multiple instance handler then you will 
have to devise a mechanism, whether by OLE, DDE, etc, whereby the new instance 
can pass the parameters to the existing instance, and then kill itself. If your 
app takes no special actions to identify instances then the file will be opened 
in the new instance.

This is a little simplified, because Explorer can also communicate with 
applications using DDE, but the mechanism of that is something I don't know 
anything about. However I would guess you would be implementing a DDE server or 
client in your application, and Explorer's association would be set up to talk 
to your app using DDE. If it can then talk to the copy of your app that is 
already loaded in memory, then presumably you can transfer the file to the 
application.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to