用VB如何终止explorer.exe然后又运行它!

来源:百度知道 编辑:UC知道 时间:2024/05/22 06:28:27
提供完整可行的源码...给高分!代码要精简

9x不一定有TaskKill程序:
VB纯代码(不用引用)
Const sEndProess As String = "explorer.exe" '注意必须小写
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Private Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long

Private Declare Function Terminat