﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>学习日记 &#187; 杀进程</title>
	<atom:link href="https://www.softwareace.cn/?feed=rss2&#038;tag=%E6%9D%80%E8%BF%9B%E7%A8%8B" rel="self" type="application/rss+xml" />
	<link>https://www.softwareace.cn</link>
	<description>时刻想着为自己的产品多做一些对他好的事情</description>
	<lastBuildDate>Fri, 20 Mar 2026 06:58:28 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>枚举 杀死进程</title>
		<link>https://www.softwareace.cn/?p=57</link>
		<comments>https://www.softwareace.cn/?p=57#comments</comments>
		<pubDate>Tue, 15 Jan 2013 10:02:13 +0000</pubDate>
		<dc:creator><![CDATA[littlesu]]></dc:creator>
				<category><![CDATA[开发经验]]></category>
		<category><![CDATA[杀进程]]></category>

		<guid isPermaLink="false">http://192.168.0.106/?p=57</guid>
		<description><![CDATA[[crayon-6a09ebeed9e44105644013/]]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">void CKillProcessDlg::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	CString processName;
	m_processName.GetWindowText(processName);
	CString strMsg;
	strMsg += &amp;quot;一共杀死进程&amp;quot;;
	strMsg += processName;
	CString str;
	str.Format( &amp;quot;%d 个&amp;quot;, KillProcess(processName));
	strMsg += str;
	AfxMessageBox(strMsg,MB_OK);
	//OnOK();
}

int CKillProcessDlg::KillProcess(CString sItemText)
{
	PROCESSENTRY32 pe;
	HANDLE hProcess;
	CString filepath;
	HANDLE hShot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
	pe.dwSize=sizeof(PROCESSENTRY32);
	int n = 0;
	if(Process32First(hShot,&amp;amp;pe))
	{
		do
		{
			if(strcmp(pe.szExeFile,sItemText)==0)
			{
				hProcess=OpenProcess(PROCESS_ALL_ACCESS,FALSE,pe.th32ProcessID);
				TerminateProcess(hProcess,0);
				++n;
			}
		}
		while(Process32Next(hShot,&amp;amp;pe));
	}
	CloseHandle(hShot);
	return n;
}</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=57</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
