Depends. Are you trying to determine if an instance of a program you are starting is already running or are you trying to write a program that will determine how many instances of x program are running?
Also, you have been posting here very frequently which is great, but try and do some research on your queries before you come and post here. You have been pretty good with posting relevant code and telling us what you have and have not done to correct your problem, but in the case of the question you posed above, you could have easily gone to google to look up information about this type of thing.
hth
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========