8

In OS X 10.9 and below, we can get the process serial number of the current running process with:

ProcessSerialNumber pen;
GetCurrentProcess( &psn );

However, GetCurrentProcess() is now deprecated and I'm unsure how to find a process' serial number with NSRunningApplication.

Lenny
  • 388
  • 3
  • 15

1 Answers1

3

to get ProcessSerialNumber you can use:

ProcessSerialNumber psn;
psn.highLongOfPSN = 0;
psn.lowLongOfPSN = kCurrentProcess;
Diana Vallverdu
  • 321
  • 4
  • 13