Advertisement
4_2005-2006 Windows System Services #149701

DetectPreviousInstance

How do I prevent multiple instances of my program? In VB 3 and above, the property App.PrevInstance is set to True if an older instance of the program already exist.

AI

AI Samenvatting: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Broncode
original-source
Sub Form_Load () 
  If App.PrevInstance Then 
    SaveTitle$ = App.Title 
    App.Title = "... duplicate instance." 'Pretty, eh? 
    Form1.Caption = "... duplicate instance." 
    AppActivate SaveTitle$ 
    SendKeys "% R", True 
    End 
  End If 
End Sub
Originele reacties (3)
Hersteld van de Wayback Machine