1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Option Explicit
Private Type MEMORYSTATUS
dwlength As Long '32
dwmemoryload As Long 'pourcentage mémoire utilisée
dwtotalphys As Long '
dwavailphys As Long 'mémoire physique disponible en octets
dwavailpagefile As Long
dwtotalvirtual As Long '
dwavailvirtual As Long '
End Type
Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpmstmemstat As MEMORYSTATUS)
Private Sub Form_Activate()
timer1.Enabled = True
timer1.Interval = 1
End Sub
Private Sub timer1_Timer()
Dim memoire As MEMORYSTATUS, tata$, toto$
memoire.dwlength = Len(memoire)
GlobalMemoryStatus memoire
With memoire
tata$ = Str((.dwavailphys / 1024))
toto$ = Str((.dwmemoryload))
Label1.Caption = tata$
Label2.Caption = toto$ & "%"
End With
End Sub |
Partager