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
To get a list of running applications:
NSArray *appNames = [[NSWorkspace sharedWorkspace] runningApplications];
To get the active application:
NSRunningApplication *currentApp = [NSRunningApplication currentApplication];
Here's a sample project from Apple:
http://developer.apple.com/mac/library/samplecode/AppList/index.html#//apple_ref/doc/uid/DTS40008859
These all require 10.6, according to the documentation.