Click to See Complete Forum and Search --> : My Applications Already Open...


Atlantisoft
February 26th, 2000, 08:36 PM
My program will pop up when an Audio CD is put in the CD-Rom, and load and play the cd. If i already have an instance of my application open, i want the new one (the one that opened to play the cd that was just entered) to not open (or open and close in the backround if nessecary), tell my other instance to load the new cd, and then close the second instance of my application. is this possible?

Cakkie
February 27th, 2000, 07:13 AM
The first problem is easy, just add these lines of code in your statup-object of your program (like sub main()):

public sub main()

if app.previnstance then

' this will end the progam if another instance is already running
end

end if

end sub



The second problem, telling it that the is a new cd, is harder to do. You might just set a timer wich checks ever X seconds for a new cd, and when found, plays it. Or.. you can try and use DDE, but i'm not familiar with this. Maybe somebody else...?

Tom Cannaerts
slisse@planetinternet.be

The best way to escape a problem, is to solve it.