回复 6楼 wmf2014
用下面代码,第二次运行时,FORM1窗口没有显示出来,点击无反应.第一次运行后窗口隐藏成托盘图标,第二次没反应
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