A Way to Programically Control NT/2000 Performance Monitor?

Is there a way to programmically control the NT/2000 Performance Monitor? Programmically set up counters, parse logs, run code based on findings, etc; anybody can point me to some basic info on this possibility?

Thank you!
--llyal