Vista: Get WinSat Info
Windows Vista has a performance index for your hardware. The scores range from 1(worst) to 5.9(best). If your application uses a lot of graphics you might get poor performance on a computer with a graphics score of 1. You can use this number to scale back on the graphics to improve your apps performance. This example gets displays the scores in the forms paint event. For this example add a reference to the WinSat 1.0 type library in the com tab.
Imports WINSATLib
Imports System.Text
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim ws As New CQueryWinSAT
Dim sbInfo As New StringBuilder
For x As Integer = 0 To 4
Dim info As IProvideWinSATAssessmentInfo = ws.Info.GetAssessmentInfo(x)
sbInfo.Append(info.Title & vbCrLf)
sbInfo.Append(info.Description & vbCrLf)
sbInfo.Append(info.Score & vbCrLf & vbCrLf)
Next
e.Graphics.DrawString(sbInfo.ToString, Me.Font, Brushes.Black, 0, 0)
End Sub
End Class