Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Sub Main()
If App.PrevInstance Then
'Form1 为你程序主窗口标题,不要和别的程序一样
SetForegroundWindow FindWindow(vbNullString, App.Title)
Else
Form1.Show
End If
End Sub