1、隐藏线程不让其显示在“关闭程序”中:
Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
注册服务(在“关闭程序”中隐藏)
Dim pid As Long
pid = GetCurrentProcessId()
RegisterServiceProcess pid, 1
取消已注册服务
Dim pid As Long
pid = GetCurrentProcessId()
RegisterServiceProcess pid, 0
2、If App.PreInstance then msgbox "Application is running"