The attached project shows how to use API calls to retrieve the Windows version information for Win95 through Vista. I've only checked out this revised version on XP but others have tried it on Win98, 2000, 2003, and Vista and reported that it worked.
A posible further enhancement would be to get the service pack level.
Let me know if you encounter any problems with it.