Board index » delphi » Help: Opening files into a running program from Explorer

Help: Opening files into a running program from Explorer

HI!  I have written an MDI application.  When I double-click on a file in
the Explorer, I want this file to open in the same Window (like WinWord) and
not in a new application.  I think I must use a DDE Server but HOW?  Any
information in this regard would be GREATLY appreciated.  Thanks....

 

Re:Help: Opening files into a running program from Explorer


In article <6e1bsg$2f...@news2.i-2000.com>, Louis S. Berman
<l...@braintree.com> writes

Quote
>HI!  I have written an MDI application.  When I double-click on a file in
>the Explorer, I want this file to open in the same Window (like WinWord) and
>not in a new application.  I think I must use a DDE Server but HOW?  Any
>information in this regard would be GREATLY appreciated.  Thanks....

I haven't tried this, but apparently the key is a file association in
Windows.  Alexander Philippou in Corel.Developers.Paradox (thread: Corel
Invites you to participate in release 9 - Compromising full control of
apps) writes

[context snipped - it cites what you want to do as a problem to avoid]

Quote
>The problem arises from the file association in the Windows Explorer,
>which is "pdxwin32.exe" -b "%1". Since -b is included in the command-
>line options, the current Paradox session is used to open all Paradox-
>related files.

--
Alistair Wall

Re:Help: Opening files into a running program from Explorer


Quote
>HI!  I have written an MDI application.  When I double-click on a file in
>the Explorer, I want this file to open in the same Window (like WinWord)
and
>not in a new application.  I think I must use a DDE Server but HOW?  Any
>information in this regard would be GREATLY appreciated.  Thanks....

You do need some kind of communication between instances of your
application, you're right.  The trick is, you have to have your application,
before it creates the forms and so on, check to see if another instance is
running.  If not, run normally.  If so, send a message to your other
application indicating which file to open, and then terminate the second
instance.  Look for "interapplication communication" or something similiar
on the Delphi Super Page... www.sunsite.icm.edu.pl/delphi

Let me know how it works out...

Eric Lawrence
Applications Architect
Bayden Systems
delta...@wam.umd.edu
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Re:Help: Opening files into a running program from Explorer


Hi,

Quote
>I haven't tried this, but apparently the key is a file association in
>Windows.  Alexander Philippou in Corel.Developers.Paradox (thread: Corel

Yes, this does start you program when you double click on file in explorer.
But that way it just opens another copy of application.
We've made a component named Tapplicata which let's you control some
properties of TApplication and TScreen Object, plus alows to limit number
of active copies your application can have. And finally it passes all comand
line parameters to first instance if it's alreadyt runing.
Try it at http://users.voras.lt/~gintaras/bs

_________________________________________
Gintaras Pikelis - Baltic Solutions
e-mail : Ginta...@Voras.lt
http://users.voras.lt/~gintaras/bs

Other Threads