Otra forma de hacerlo mas compacto usando las bondades de C++:
Código:
bool IsRunning16_(char* Name)
{
struct TRuningProcess16{
char* Name;
bool Running;
static BOOL WINAPI
ProcessTasks(DWORD dwThreadId, WORD hMod16, WORD hTask16, PSZ pszModName, PSZ pszFileName, LPARAM PE)
{
if(strstr(strupr(pszFileName), strupr(((TRuningProcess16*)PE)->Name)))
return ((TRuningProcess16*)PE)->Running = true;
return false;
}
static BOOL WINAPI
ProcessVDMs(DWORD dwProcessId, DWORD dwAttrib, LPARAM PE)
{
VDMEnumTaskWOWEx(dwProcessId, (TASKENUMPROCEX)ProcessTasks, PE);
return ((TProcessEnumData16*)PE)->Running;
}
} PE = {Name,0};
VDMEnumProcessWOW((PROCESSENUMPROC)ProcessVDMs, (LPARAM)&PE);
return PE.Running;
}
Saludos.