I want to find which applications are running, particularly I want to know which one has a window that has focus. So at any given time I want the app to know which applicati
Have a look at GetFrontProcess and CopyProcessName (or GetProcessInformation).
Or have a look at NSWorkspace::activeApplication.
EDIT: the reference documentation says
It is strongly suggested that you use the NSRunningApplication methods currentApplication or active to retrieve this information in post Mac OS X v10.6 targeted applications.