checking for a program in memory

I've been trying to find a way to check for a program that is currently running. Let's say the program is x.exe

does anyone know how to check for a program in memory with c++? I want to stick it in a loop like this:

1
2
3
4
5
bool flag = true //true means program is running
while(flag = true)
{
     flag = //code to check for program in bool form
}
Last edited on
closed account (z05DSL3A)
I think you want the 'Process Status API', you can read about it here:
http://msdn2.microsoft.com/en-us/library/ms684884(VS.85).aspx

The article "Enumerating Windows Processes" may also be of help.
http://www.alexfedotov.com/articles/enumproc.asp

Last edited on
Topic archived. No new replies allowed.