منع البرنامج من التحميل مرتين

هذا الكود يمنع البرنامج من التحميل من نفس المسار مرتين ثم يقوم بتنشيط البرنامج
الكود :
Function AnotherInstance() As Integer
Dim AppTitle$
If App.PrevInstance Then

AppTitle$ = App.Title

App.Title = "No longer want this app running..."

AppActivate AppTitle$

AnotherInstance = True
Else

AnotherInstance = False
End If
End Function

Sub Form_Load()

If AnotherInstance() Then End

End Sub

لتحميل السورس

اضغط هنـــــــــا