<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0048)http://topic.csdn.net/t/20030903/15/2219292.html -->
<HTML lang=zh-CN xml:lang="zh-CN"
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>vb里怎么能关闭别的进程? VB / API - CSDN社区 community.csdn.net</TITLE>
<META content=all name=robots>
<META http-equiv=Content-Language content=zh-CN>
<META http-equiv=Content-Type content="text/html; charset=utf-8"><LINK
href="vb里怎么能关闭别的进程 VB - API - CSDN社区 community_csdn_net.files/topic.css"
type=text/css rel=stylesheet>
<SCRIPT src="vb里怎么能关闭别的进程 VB - API - CSDN社区 community_csdn_net.files/Topic.js"
type=text/javascript></SCRIPT>
<META
content="hprogram terminateprocess byval openprocess kernel32 sub as long click lib command VB API"
name=Keywords>
<META content=在XP下调用TerminateProcess(ProcessId,ExitCode)怎么都返回0,有其他函数可以用吗?
name=description>
<META content="MSHTML 6.00.2800.1605" name=GENERATOR></HEAD>
<BODY>
<DIV id=wrapper>
<DIV id=innerWrapper>
<DIV id=logo>
<SCRIPT
src="vb里怎么能关闭别的进程 VB - API - CSDN社区 community_csdn_net.files/csdn_ggmm.js"></SCRIPT>
<SCRIPT type=text/javascript>show_ads_zone(230);</SCRIPT>
<IMG style="DISPLAY: none" alt=""
src="vb里怎么能关闭别的进程 VB - API - CSDN社区 community_csdn_net.files/pv.aspx">
<DIV>
<TABLE class=CSDN-PHF id=CSDNPHL cellSpacing=1 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><A href="http://www.csdn.net/" rel=external>CSDN首页</A></TD>
<TD><A href="http://news.csdn.net/" rel=external>新闻</A></TD>
<TD><A href="http://bbs.csdn.net/" rel=external><STRONG>论坛</STRONG></A></TD>
<TD><A href="http://groups.csdn.net/"
rel=external><STRONG>小组</STRONG></A></TD>
<TD><A href="http://blog.csdn.net/"
rel=external><STRONG>Blog</STRONG></A></TD>
<TD><A href="http://dev.csdn.net/" rel=external>文档</A></TD>
<TD><A href="http://download.csdn.net/" rel=external>下载</A></TD>
<TD><A href="http://book.csdn.net/" rel=external>读书</A></TD>
<TD><A href="http://tag.csdn.net/"
rel=external><STRONG>Tag</STRONG></A></TD>
<TD><A href="http://wz.csdn.net/" rel=external><STRONG>网摘</STRONG></A></TD>
<TD><A href="http://search.csdn.net/"
rel=external><STRONG>搜索</STRONG></A></TD>
<TD><A href="http://dotnet.csdn.net/"
rel=external><STRONG>.NET</STRONG></A></TD>
<TD><A href="http://java.csdn.net/"
rel=external><STRONG>Java</STRONG></A></TD>
<TD><A href="http://gamedev.csdn.net/" rel=external>游戏</A></TD>
<TD><A href="http://live.csdn.net/" rel=external>视频</A></TD>
<TD><A href="http://job.csdn.net/" rel=external>人才</A></TD>
<TD><A href="http://prj.csdn.net/" rel=external>外包</A></TD>
<TD><A href="http://www.dearbook.com.cn/" rel=external>第二书店</A></TD>
<TD><A href="http://www.programmer.com.cn/"
rel=external>程序员</A></TD></TR></TBODY></TABLE>
<DIV id=logo>
<TABLE cellSpacing=0 cellPadding=0 width=760 border=0>
<TBODY>
<TR>
<TD width=760 height=36><A href="http://g.csdn.net/5032319"
target=_blank><IMG height=40
src="vb里怎么能关闭别的进程 VB - API - CSDN社区 community_csdn_net.files/760.40.gif"
width=760 border=0></A></TD></TR>
<TR id=bigFlash style="TEXT-ALIGN: center">
<TD><A href="http://g.csdn.net/5032318" target=_blank><IMG height=300
src="vb里怎么能关闭别的进程 VB - API - CSDN社区 community_csdn_net.files/760.300.jpg"
width=760 border=0></A></TD></TR></TBODY></TABLE>
<SCRIPT type=text/javascript>setTimeout("document.getElementById('bigFlash').style.display='none'", 5000);</SCRIPT>
</DIV>
<TABLE>
<TBODY>
<TR>
<TD><A href="http://community.csdn.net/" rel=external><IMG class=logo
alt=CSDN社区
src="vb里怎么能关闭别的进程 VB - API - CSDN社区 community_csdn_net.files/logo_csdn.gif"></A></TD>
<TD>
<SCRIPT type=text/javascript>show_ads_zone(228);</SCRIPT>
</TD>
<TD>
<SCRIPT type=text/javascript>show_ads_zone(229);</SCRIPT>
</TD></TR></TBODY></TABLE>
<DIV id=navigation>
<DIV id=search>
<DIV id=innerSearch><INPUT id=key onfocus="value=''"><A
onclick="return Search()"
href="http://topic.csdn.net/t/20030903/15/2219292.html#">搜索</A> | <A
title=功能强大的网络收藏夹,一秒钟操作就可以轻松实现保存带来的价值、分享带来的快乐
href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(saveit=window.open('http://wz.csdn.net/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'saveit','scrollbars=no,width=590,height=300,left=75,top=20,status=no,resizable=yes'));saveit.focus();">收藏</A> | <A
onclick="return Print()"
href="http://topic.csdn.net/t/20030903/15/2219292.html#">打印</A> | <A
onclick="return Close()"
href="http://topic.csdn.net/t/20030903/15/2219292.html#">关闭</A> </DIV></DIV>
<DIV><A class=CSDNRoom href="http://community.csdn.net/"
rel=external>CSDN社区</A> > <A
href="http://community.csdn.net/Expert/ForumsList.asp?typenum=1&roomid=51"
rel=external>VB</A> > <A
href="http://community.csdn.net/Expert/ForumList.asp?typenum=1&roomid=5104"
rel=external>API</A> </DIV></DIV>
<DIV id=mainWrapper>
<DIV id=pageContent>
<DIV id=innerContent>
<H1>vb里怎么能关闭别的进程?</H1>
<DIV class=author><A class=anchor name=Top>楼主</A>Bosee(電腦頑童)<INPUT class=user3 title="三级用户 该版得分小于等于1000分,大于500分" type=button>2003-09-03
15:14:23 在 VB / API 提问</DIV>
<P>在XP下调用TerminateProcess(ProcessId,ExitCode)怎么都返回0,有其他函数可以用吗?
<SPAN>问题点数:30、回复次数:1</SPAN><A
href="http://topic.csdn.net/t/20030903/15/2219292.html#">Top</A> </P>
<DIV class=tagad><IFRAME
src="vb里怎么能关闭别的进程 VB - API - CSDN社区 community_csdn_net.files/Board.htm"
frameBorder=0 scrolling=no></IFRAME></DIV>
<H3><STRONG><A class=anchor name=r_15115084>1 楼</A>wyxxzg77(www)<INPUT class=user2 title="二级用户 该版得分小于等于500分,大于100分" type=button></STRONG><SPAN>回复于
2003-09-03 15:21:06 得分 <EM>30</EM></SPAN></H3>
<P> <BR> Private Declare
Function OpenProcess Lib "kernel32" (ByVal
dwDesiredAccess _ <BR> As
Long, ByVal bInheritHandle As Long,
ByVal dwProcessId As Long) As Long
<BR> Private Declare Function
TerminateProcess Lib "kernel32" (ByVal
hProcess _ <BR> As
Long, ByVal uExitCode As Long) As Long
<BR> Dim x <BR>
<BR>
Private Sub Command1_Click() <BR>
x = Shell("F:\财务成本核算\exe\menu.exe", 1)
<BR> End Sub <BR>
<BR>
Private Sub Command2_Click() <BR>
hProgram = OpenProcess(1, False,
x) <