Do you mean:
A - via code for use in a program
or
B - you just looking to find out how many threads a program has open at
a given time
If A the only way I know is to increment a counter when they are created
and decrement it when they are destroyed. If someone suggests something
else I'm interested too. If B you can use Task Manger--you might have
to add that column to the display.