Yes, that's clear, but how to get this list? I have found 2 ways: ps
-ef and [[NSWorkspace sharedWorkspace] launchedApplications].
There are underlying APIs that tools like ps and top use; you can call
those. I'm not familiar with the details, however. You can look in the
Darwin repository for the source code of either of those tools, or you
can ask on the darwin-userlevel mailing list. (Cocoa-dev is off topic
for this, since it's not related to any Cocoa APIs.)
NSWorkspace isn't going to help, because it's in AppKit, and daemon
processes (the only kind that could be running without loginwindow)
aren't allowed to link against AppKit.