''''将进程注册为服务,Windows 2000 系统不可用 Private Declare Function RegisterServiceProcess Lib _ "kernel32" ( _ ByVal hProcess As Long, _ ByVal uFlags As Long _ ) As Long
''''获取当前进程 ID Private Declare Function GetCurrentProcessId Lib _ "kernel32" () As Long
''''在此程序中用来屏蔽热键 Private Declare Function SystemParametersInfo Lib _ "User32" Alias "SystemParametersInfoA" ( _ ByVal uAction As Long, _ ByVal uParam As Long, _ ByRef lpvParam As Any, _ ByVal fuWinIni As Long _ ) As Long
''''屏蔽热键,对于 Windows 2000 系统无效 Private Const SPI_SCREENSAVERRUNNING = 97
''''将窗体设为顶层 Private Declare Function SetWindowPos Lib _ "User32" ( _ ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal cx As Long, _ ByVal cy As Long, _ ByVal wFlags As Long _ ) As Long
''''将窗体设为最前 Private Const HWND_TOPMOST = -1
''''获取桌面句柄 Private Declare Function GetDesktopWindow Lib _ "User32" () As Long
''''获取窗体句柄 Private Declare Function GetWindow Lib _ "User32" ( _ ByVal hwnd As Long, _ ByVal wCmd As Long _ ) As Long
''''获取子窗体句柄 Private Const GW_CHILD = 5
''''获取下一个窗体句柄 Private Const GW_HWNDNEXT = 2
''''获取窗体标题 Private Declare Function GetWindowText Lib _ "User32" Alias "GetWindowTextA" ( _ ByVal hwnd As Long, _ ByVal lpString As String, _ ByVal cch As Long _ ) As Long
''''发送消息,用来关闭指定程序,比如杀毒,网管 Private Declare Function PostMessage Lib _ "User32" Alias "PostMessageA" ( _ ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long _ ) As Long
''''关闭程序 Private Const WM_CLOSE = &H10
''''退出程序 Private Const WM_QUIT = &H12
''''查找窗体 Private Declare Function FindWindow Lib _ "User32" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String _ ) As Long
''''获取类名 Private Declare Function GetClassName Lib _ "User32" Alias "GetClassNameA" ( _ ByVal hwnd As Long, _ ByVal lpClassName As String, _ ByVal nMaxCount As Long _ ) As Long
''''延时以确保程序已关闭 Private Declare Sub Sleep Lib _ "kernel32" ( _ ByVal dwMilliseconds As Long _ )
''''获得 Windows 系统目录 Private Declare Function GetSystemDirectory Lib _ "kernel32" Alias "GetSystemDirectoryA" ( _ ByVal lpBuffer As String, _ ByVal nSize As Long _ ) As Long
''''销毁窗体,释放内存 Private Declare Function DestroyWindow Lib _ "User32" ( _ ByVal hwnd As Long _ ) As Long
''''销毁句柄,释放内存 Private Declare Function CloseHandle Lib _ "kernel32" ( _ ByVal hObject As Long _ ) As Long
''''枚举窗体 Private Declare Function EnumWindows Lib _ "User32" ( _ ByVal lpEnumFunc As Long, _ ByVal lParam As Long _ ) As Long
Private Sub Form_Load()
''''只运行应用程序的一个实例 If App.PrevInstance = True Then End