by Sergio del Rio (3 Submissions)
Category: VB function enhancement
Compatability: VB Script
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (7 Votes)
This code checks for a previous instance of the program. This is not like the App.PrevInstance property. This checks the prevInstance no matter the location of the file, or the name of the app. You don't have to call DestroyWindow to destroy the created window, since when you quit the application, it is self destroyed. This may not work in the VB IDE, because the window is created by VB6.EXE. In this case you can call DestroyWindow in the Form_Unload().