|
-
Feb 3rd, 2004, 08:27 PM
#1
Thread Starter
Fanatic Member
PrevInstance kills FIRST instance
I want just one instance of my app running at a time. When a second instance of my app occurs, I need to have the app start from scratch. I can't just set focus to the first instance and kill the second instance.
My app is only run when called from another program. Certain events in that other program cause it to set some data and then run my app. My app then gets the data and does its thing. If the user doesn't close my app when they are done, the other program will keep running new instances. If a second instances occurs, I want to kill one instance. But, whichever instance of my app that I keep running needs to go get the new data. So, if there is a PrevInstance, I need to either:
1) Kill the first instance and let the second instance run and load the new data.
or
2) Kill the second instance and somehow get the first instance to load the new data. I can't find any Form events (Initialize, Load, Activate, GotFocus, etc.) that I can cause to happen from the second event (especially considering that the new data shuld only be loaded by the program and never the user. So I'm thinking I should go with option 1, but I'm not sure how to kill the first instance of the app?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|