Is there a way to get the process id of my application in C ++?

Is there a way to get the process id of my application in C ++? I use Carbon wireframe but not Cocoa ...

+3
source share
3 answers

Can you use the getpid () function found in unistd.h?

osx link

+5
source

GetProcessPID is what you need. This takes a ProcessSerialNumber, which you can get from GetCurrentProcess.

+2
source

, GetCurrentProcess, kCurrentProcess.

( getpid , PID .)

+1

Source: https://habr.com/ru/post/1696654/


All Articles