To get the PID of the current application, the Process::GetCurrent function needs to be used. This means that it has to get the handle to the process, etc. It would be better to just have a function that returns the PID directly instead of having to do: Process::GetCurrent().GetPID().