Click to See Complete Forum and Search --> : How can I make my application load data when doubleclicking on files ?


May 20th, 1999, 02:48 AM
I have the following problem: I want my application to start just one time (single instance) so, if u want to start it another time, the new startet application checks if the application was started earlier and stops if it finds an earlier started version. Befor the application ends, it activates the earlier started application so that its windows come in front.
With a lot of good help of some great people who answered my last post, I could make it so far. Thanks a lot again for your help !!!!!
Now my question: How can I make the earlier started Version of my application load data if the user for example doubleclicked on a file in explorer to open it while the earlier started version is still running ???
(second instance starts, finds first instance, activates first instance, second instance finishes, how can first instance load data ???)

Rauli Ikonen
May 23rd, 1999, 04:09 PM
This propably isn't the correct way to do it, but you could send a WM_COPYDATA message (containing the filename the user double clicked) to the first instance of your application before terminating the second one.

Dan Haddix
May 23rd, 1999, 06:28 PM
FYI: This is the default behavor of an MDI application. You may want to consider that instead.