Thanks a lot Nigel the program is now running but this was not which i was expecting i was expecting it to display all the applications that ran on that computer.

eg, Internet explorer,Word,Power point etc.

Do you know of any such api or function which enlists applications?

Also do you know of any api which enlists the the hardware devices like
mouse,keyboard,NIC etc