SUMMARY: On Windows, each time the user double clicks a data file, a
separate copy of my app is opened. It should open the original
instance. Can this be done?
DETAIL:
I've modified the registry (thanks to the MBS plugin) to make my app
open when a .OTD file is double clicked.
I accept that on Windows double clicking the app icon again itself
will open a second copy of your app and there are ways to handle this
as previously posted to the list.
Double clicking a document icon again and having the same document
open in 2 separate copies of an app seems like undesirable behaviour
for any app.
The only solution I can see is to use Mutex to detect if your app is
already running and then use local network communication to talk to
the other instance of your app and tell it to load this document if
needed. Is there a more elegant solution? Is there a way to stop a
separate instance from opening at the source?
PS - this is the MBS plugin code my app runs on each launch:
// Make data file double clickable
dim w as RegistryFileTypeMBS
w=new RegistryFileTypeMBS
w.AppFile=app.ExecutableFile
w.Description="OfficeTime Data File"
w.FileType="OfficeTime file"
w.Extension=".otd"
w.OpenDescription="Open"
w.IconFile = app.ApplicationFileMBS
dim err as integer
err = w.Create
If err <> 0 then
debug.Warning "Set data file registry failed: " + str(err)
End If
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>