Api # FORM
Option Explicit Private Sub Form_Click() Dim ms As MEMORYSTATUS Me.Cls ms.dwLength = Len(ms) GlobalMemoryStatus ms Print "Total physical memory: "; ms.dwTotalPhys Print "Memoria fisica disponibile: "; ms.dwAvailPhys Print "32 " & ms.dwLength 'As Long ' 32 Print "percent of memory in use "; ms.dwMemoryLoad 'As Long ' percent of memory in use Print " bytes of physical memory "; ms.dwTotalPhys 'As Long ' bytes of physical memory Print "free physical memory bytes "; ms.dwAvailPhys 'As Long ' free physical memory bytes Print " bytes of paging file "; ms.dwTotalPageFile 'As Long ' bytes of paging file Print "free bytes of paging file "; ms.dwAvailPageFile 'As Long ' free bytes of paging file Print "user bytes of address space "; ms.dwTotalVirtual 'As Long ' user bytes of address space Print "free user bytes "; ms.dwAvailVirtual 'As Long ' free user bytes End Sub MODULO BAS Option Explicit Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type Type MEMORYSTATUS dwLength As Long ' 32 dwMemoryLoad As Long ' percent of memory in use dwTotalPhys As Long ' bytes of physical memory dwAvailPhys As Long ' free physical memory bytes dwTotalPageFile As Long ' bytes of paging file dwAvailPageFile As Long ' free bytes of paging file dwTotalVirtual As Long ' user bytes of address space dwAvailVirtual As Long ' free user bytes End Type Type SYSTEMTIME wYear As Long wMonth As Long wDayOfWeek As Long wDay As Long wHour As Long wMinute As Long wSecond As Long wMilliseconds As Long End Type Declare Sub GetSystemTime Lib "KERNEL32" (lpSystemTime As SYSTEMTIME) Declare Sub GlobalMemoryStatus Lib "KERNEL32" (lpmstMemStat As MEMORYSTATUS) Declare Function GetFocus& Lib "user32" () Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hWnd&, ByVal message&, ByVal wParam&, lParam As Any) Declare Function SendMessageByString& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) Declare Function SystemTimeToFileTime Lib "KERNEL32" (lpSystemTime As SYSTEMTIME, lpFileTime As FILETIME) As Long |