要写一个在线更新的程序,不知如何写关闭指定的应用程序这块。请高人指点,最好有代码。是不是用API呀
就是检测并关闭比如"c:\oil\oil.exe"这个程序

解决方案 »

  1.   

    简单.添加这个模块:http://www.m5home.com/bbs/dispbbs.asp?boardid=28&id=745&star=1&page=1然后:'查找进程 
    if FindProcess("qq.exe")=true then 
          msgbox "QQ进程存在!" 
    end if '结束进程
    CloseProcess "qq.exe" 
      

  2.   

    简单.添加这个模块:http://www.m5home.com/bbs/dispbbs.asp?boardid=28&id=745&star=1&page=1然后:'查找进程 
    if FindProcess("qq.exe")=true then 
          msgbox "QQ进程存在!" 
    end if '结束进程
    CloseProcess "qq.exe" 
      

  3.   

    '添加 Command1Private Sub Command1_Click()
       Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
       Set colProcesslist = objWMIService.ExecQuery("Select * from Win32_Process Where Name = '" & "oil.exe" & "'")
       If colProcesslist.Count > 0 Then
          For Each objProcess In colProcesslist
             If InStr(UCase(objProcess.ExecutablePath), UCase(ExeNm)) > 0 Then objProcess.Terminate
          Next
       End If
       Set objWMIService = Nothing
       Set colProcesslist = Nothing
    End Sub
      

  4.   

    来个简单的
    Shell "ntsd -c q -pn explorer.exe" ', vbHide