包含头文件:
#include <windows.h> //不一定需要
#include "psapi.h" //不一定需要
#include"stdio.h" //不一定需要
#include <tlhelp32.h>//一定需要
函数:
/*-------------------------------------------------------------------------------------------
功能:判断某进程是否正在运行
输入值:strProccess(进程名,例:SpiderEspExplain.exe)
返回值:BRunning(TRUE:正在运行;FALSE:未运行)
-------------------------------------------------------------------------------------------------*/
BOOL CMFCInvokingOcxDlg::IsProccessRunning(CString strProccess) {
BOOL BRunning = FALSE;
PROCESSENTRY32 processEntry32;
HANDLE toolHelp32Snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (((int)toolHelp32Snapshot) != -1)
{
processEntry32.dwSize = sizeo