- #include "Tlhelp32.h"
- bool CheckRunning( char* exe )
- {
- HANDLE handle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
- if (handle == NULL) false;
- PROCESSENTRY32 processinfo;
- processinfo.dwSize = sizeof(processinfo);
- bool status = Process32First(handle, &processinfo);
- while (status == true)
- {
- if( _stricmp(exe, processinfo.szExeFile) == 0 )
- {
- CloseHandle(handle);
- return true;
- }
- status = Process32Next(handle, &processinfo);
- }
- CloseHandle(handle);
- return false;
- }
检查一个exe是不是在运行
最新推荐文章于 2019-07-02 14:24:17 发布