check Process

hi
how i can check PID ?
example

this code not working
only example
1
2
3
4
if(firefox== run)
{
 cout<<"firefox is runing :D";
}

how ?
Last edited on
?? Why would that work? What data type is 'firefox'?

If I were to read your post as pseudo-code, I would say you want to know if a specific executable is running.

In Windows you can go1 of 2 routes:

1. Use CreateToolHelp32Snapshot() (http://a.ly/5Y6 ).
2. Use EnumProcesses() (http://a.ly/5Y7 ).

The first one returns a snapshot handle that you can use with Process32First()/Process32Next() to obtain process information (including the executable filename); the second one return process ID's that can be used with OpenProcess() and then GetProcessImageFileName() to obtain the executable's filename.
i see before this
1. Use CreateToolHelp32Snapshot() (http://a.ly/5Y6 ).
2. Use EnumProcesses() (http://a.ly/5Y7 ).
but i don't know how use that code :(
if u cant help me . give me example
There are a LOT of examples. Google "CreateToolHelp32Snapshot example". See the second result. If not, keep googling. If not, Google up samples for the other function. You are not the first one attempting this; be confident your problem is fully solved out there. Google it up.
how can i do that ? Is not
Topic archived. No new replies allowed.