AHOI智能评测系统开发(五)[2]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 visualbear 的 blog

    dim strcomputer as string
    dim objwmiservice as object
    dim colprocesslist
    dim objprocess as object
   
    on error resume next
   
    strcomputer = "."
    set objwmiservice = getobject("winmgmts:" _
        & "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2")
'        strprocess = "excel.exe"
    set colprocesslist = objwmiservice.execquery _
        ("select * from win32_process where name = '" & strprocess & "'")
    for each objprocess in colprocesslist
        objprocess.terminate
    next
   
end sub
'********************************************************************************************

未解决的问题:由于绕不开同步执行函数中的doevens,timer总是不会溢出
积极思考中。。用脑用脑,发功。。。~~~~~

附同步执行程序:
sub shellwait(scommandline as string)               '等到外部程序执行完成
    dim hshell as long, hproc as long, lexit as long
    hshell = shell(scommandline, vbhide)
    hproc = openprocess(&h400, false, hshell)
    do
        getexitcodeprocess hproc, lexit
        doevents
    loop while lexit = &h103
end sub

本文关键:AHOI智能评测系统开发(五)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top