Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Nov : How to open a file in current app vs. new instance?

www.cryer.info
Managed Newsgroup Archive

How to open a file in current app vs. new instance?

Subject:How to open a file in current app vs. new instance?
Posted by:"David S" (now..@nohow.com)
Date:6 Nov 2006 15:19:11

Suppose you've got a Delphi app that lets you select files
somehow.  You want to open one of the files.  I'm looking for
info on how to open the file in:

* its default app
* a specific app
* a new instance of an app vs. an existing instance of the app

I'm familiar with the first two, but I'm not sure how to
distinguish whether the app is already running and if so,
whether to open the file in the existing instance or in a
completely new instance.

For example, if you've got some .pas files and you want to view
them, the default app may be Delphi (although I set my system to
use a text editor).  If you open one of these files and the
default opener isn't running, it would open Delphi or the editor
as the default app.  But if you try to open a second or third
file, how do you say whether to open it in the current Delphi or
editor app vs. starting a new instance of the app and opening it
there?

Sometimes you want them all opened in the same instance, and
sometimes it's preferable to open them in separate instances.

How do you control this from the side that's opening the file?

TIA!
-David

Replies:

www.cryer.info
Managed Newsgroup Archive