Multiple Instances
Tech Support Questions

Q. How do I prevent multiple instances of my program?

A. In VB 3, the property App.PrevInstance is set to True if an older instance of the program already exist. The following piece of code will activate the old instance and then terminate itself:
  Sub Form_Load ()
    If App.PrevInstance Then
      SaveTitle$ = App.Title
      App.Title = "... duplicate instance." 
      Form1.Caption = "... duplicate instance."
      AppActivate SaveTitle$
      SendKeys "% R", True
      End
    End If
  End Sub


[TECH SUPPORT TOC]

[HOME] [TABLE OF CONTENTS] [SEARCH]