Fetch running applications list in Linux

Hi,

I need to write a code which will fetch all the application activity on user computers including app name, time of day, duration, version, etc.
Using this I need to know which applications are running currently in user's computers.

How can it be done programmatically? I need to write the code in C/C++.
The application I am building will run in background like a daemon and will get all the running applications info and will send it to the server.

I really appreciate any help, code snippet....

Thanks a lot.
Arun

There is no single API that I know of that will provide what you want. A lot of the information you want can be obtaining from parsing the output of ps and various log files. But things like application version may be more difficult to determine.