Create a form and add 2 PerformanceCounter controls . For the first one set Catagory property to LogicalDisk , CounterName to Disk Read Bytes/sec , InstanceName to _Total for the second PerformanceCounter set CounterName to Disk Write Bytes/sec and the other values the same as the first PerformanceCounter . You will need to create 4 small images that you will use with a notifyIcon and add them to your resources such as these
<some graphics shown here>
Set the form WindowState property to Minimized and the ShowInTaskbar property to false . Add a timer set it's enabled property to true , interval 100 and add a NotifyIcon . Then try this code:
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim both As Integer = 0
If (PerformanceCounter1.NextValue > 0) Then
both += 1
End If
If (PerformanceCounter2.NextValue > 0) Then
both += 2
End If
Select Case both
Case 0
NotifyIcon1.Icon = My.Resources.blue
Case 1
NotifyIcon1.Icon = My.Resources.green
Case 2
NotifyIcon1.Icon = My.Resources.green2
Case 3
NotifyIcon1.Icon = My.Resources.greengreen
End Select
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
NotifyIcon1.Icon = My.Resources.blue
End Sub
Private Sub NotifyIcon1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles
NotifyIcon1.MouseClick
If e.Button = Windows.Forms.MouseButtons.Right Then
NotifyIcon1.Visible = False
Application.Exit()
End If
End Sub
End Class
_________________________________________________________________
Change InstanceName to monitor a particular disk drive .