rforgues@[EMAIL PROTECTED]
wrote:
> Hi,
>
> Is there a way to open multiple files in the same MDI app. I mean :
>
> 1- Double-click a file «TEST1.ABC» in Windows...
> 2- a Delphi program is opened (because the file type .ABC is
> registered with this program)...
> 3- the Delphi program retrieves the paramstr and open the file
> «TEST1.ABC» in a new MDI form...
> 4- double-click a file "TEST2.ABC file in Windows...
>
> (up to now, no problem...)
>
> 5- the Delphi program open the file «TEST2.ABC» in a new MDI form so
> we have both files open at the same time in the same program.
>
> Any way to do this?
>
> Thanks!
>
>
There are a couple of ways of handling that.
first, you can use the windows method that has been there for
some time which allows you to associate a file extension with
an application for the request. In those parameters are command
line key words that you decide to use which gets passed to
your app.
Windows can use a dynamic Data exchange service option if you
select that (DDE). With that, you're app must register it self
as a DDE server on start up and from there, windows will send
messages to your already existing app in operation...
If you don't want to do it that way, you can edit the
code in your main section of the app each time a copy of
your app starts up. This way you can decide if a copy of your
app is already operating and if so, post a custom message directly to
it containing the info that as been sent to it and then terminate the
current copy that just started up.
For this to work efficiently, you should write a simple stub app that
does scan for the existence of the main app via a "findwindow" for
example, and then, make the proper move. In either case, the stub app
will terminate at the end. How ever, before it does it should have
already either started the real app for the first time if it could not
be found and then post the command line information to it in both cases.
etc..
--
http://webpages.charter.net/jamie_5"


|