Given a program name or file name, how can I detect if it is currently running on the system?

Thanks...