hi there,
how can i get the pid of a different process using its name?
are there any functions that do this?
TIA,
rotis23
hi there,
how can i get the pid of a different process using its name?
are there any functions that do this?
TIA,
rotis23
In unix you might try getpid().
www.rt.com/man
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
And for windows
GetWindowThreadProcessId()
getpid() gives you the PID of the current process and not of any other process.
>how can i get the pid of a different process using its name?
It depends on what flavor of UNIX you are using. In Digital, you have a pseudo mount point called /proc/, in which each file is named after a process' PID. You can read a lot of information of a process just using read() on each of these files in here. But again, reading these files depends upon who the user is [permissions]. The best bet for you would be using the command 'ps'.
oops! Should have read the question properly!
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]