VB6 has a very convenient way to end a new instance of an application if the application has an instance running.
The VB code would be : If App.PrevInstance Then End
I know this could be done with API calls but I am not sure what is the best way to accomplish it in the console and windows powerbasic programs. I think one method would be to detect the window of the running programs or an other way apparantly uses "mutex" API's - which I haven't really investigated enough to understand.
Right now I need to "end" a couple of console powerbasic programs if they are launched when the programs are already running. If more than one instance of either of these programs runs it will completely corrupt a data base.
Can anyone point me to the code I need? Or to an explanation of what I need to do to solve the multiple instances problem.
Thanks
Rudy Steury
The VB code would be : If App.PrevInstance Then End
I know this could be done with API calls but I am not sure what is the best way to accomplish it in the console and windows powerbasic programs. I think one method would be to detect the window of the running programs or an other way apparantly uses "mutex" API's - which I haven't really investigated enough to understand.
Right now I need to "end" a couple of console powerbasic programs if they are launched when the programs are already running. If more than one instance of either of these programs runs it will completely corrupt a data base.
Can anyone point me to the code I need? Or to an explanation of what I need to do to solve the multiple instances problem.
Thanks
Rudy Steury
Comment