use the D3DCaps struct in the avars.h ( http://msdn.microsoft.com/en-us/library/bb172513(VS.85).aspx )

and the first google link: http://www.codeproject.com/KB/system/GetHardwareInformation.aspx