Detectar la RAM
Tienes que hacerlo por medio de la api de windows.
Defines esto en un modulo:
Option Explicit
Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
y un ejemplo en un formulario:
Option Explicit
Private Sub Form_Load()
Dim MemSts As MEMORYSTATUS
Dim Memory As Long, Msg As String
GlobalMemoryStatus MemSts
Memory = MemSts.dwTotalPhys
Msg = "Total Physical Memory: " & Format$(Memory 1024, "###,###,###") & " Kb" & vbCrLf & vbCrLf
Memory = MemSts.dwAvailPhys
Msg = Msg & "Available Physical Memory: " & Format$(Memory 1024, "###,###,###") & " Kb" & vbCrLf & vbCrLf
Memory = MemSts.dwTotalVirtual
Msg = Msg & "Total Virtual Memory: " & Format$(Memory 1024, "###,###,###") & " Kb" & vbCrLf & vbCrLf
Memory = MemSts.dwAvailVirtual
Msg = Msg & "Available Virtual Memory: " & Format$(Memory 1024, "###,###,###") & " Kb" & vbCrLf
MsgBox Msg, vbInformation
End Sub
espero que te sirva, un saludo.
Defines esto en un modulo:
Option Explicit
Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
y un ejemplo en un formulario:
Option Explicit
Private Sub Form_Load()
Dim MemSts As MEMORYSTATUS
Dim Memory As Long, Msg As String
GlobalMemoryStatus MemSts
Memory = MemSts.dwTotalPhys
Msg = "Total Physical Memory: " & Format$(Memory 1024, "###,###,###") & " Kb" & vbCrLf & vbCrLf
Memory = MemSts.dwAvailPhys
Msg = Msg & "Available Physical Memory: " & Format$(Memory 1024, "###,###,###") & " Kb" & vbCrLf & vbCrLf
Memory = MemSts.dwTotalVirtual
Msg = Msg & "Total Virtual Memory: " & Format$(Memory 1024, "###,###,###") & " Kb" & vbCrLf & vbCrLf
Memory = MemSts.dwAvailVirtual
Msg = Msg & "Available Virtual Memory: " & Format$(Memory 1024, "###,###,###") & " Kb" & vbCrLf
MsgBox Msg, vbInformation
End Sub
espero que te sirva, un saludo.
