How to obtain Vista Edition programmatically, that is Home Basic, Home Premium, Business or Ultimate ?
MSDN gives extensive answer:
Getting the System Version