home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / classlib / desaware / dwmemsta.cls < prev    next >
Encoding:
Text File  |  1996-02-18  |  2.9 KB  |  100 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "dwMemoryStatus"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. ' Class dwMemoryStatus
  11. ' Desaware API Class library
  12. ' Copyright (c) 1996 by Desaware Inc.
  13. ' All rights reserved
  14.  
  15. #If Win32 Then
  16. Private iMemoryStatus As MEMORYSTATUS
  17.  
  18. Public Sub setMEMORYSTATUS(dwLength As Long, dwMemoryLoad As Long, dwTotalPhys As Long, dwAvailPhys As Long, dwTotalPageFile As Long, dwAvailPageFile As Long, dwTotalVirtual As Long, dwAvailVirtual As Long)
  19.     iMemoryStatus.dwLength = dwLength
  20.     iMemoryStatus.dwMemoryLoad = dwMemoryLoad
  21.     iMemoryStatus.dwTotalPhys = dwTotalPhys
  22.     iMemoryStatus.dwAvailPhys = dwAvailPhys
  23.     iMemoryStatus.dwTotalPageFile = dwTotalPageFile
  24.     iMemoryStatus.dwAvailPageFile = dwAvailPageFile
  25.     iMemoryStatus.dwTotalVirtual = dwTotalVirtual
  26.     iMemoryStatus.dwAvailVirtual = dwAvailVirtual
  27. End Sub
  28.  
  29. Public Sub CopyFromMemoryStatus(ByVal lpMemoryStatus As Long)
  30.         
  31.     If lpMemoryStatus = 0 Then RaiseError 5, "dwmemorystatus"
  32.     agCopyData ByVal lpMemoryStatus, iMemoryStatus, LenB(iMemoryStatus)
  33. End Sub
  34.  
  35. Public Property Get dwLength() As Long
  36.     dwLength = iMemoryStatus.dwLength
  37. End Property
  38.  
  39. Public Property Let dwLength(vNewValue As Long)
  40.     iMemoryStatus.dwLength = vNewValue
  41. End Property
  42.  
  43. Public Property Get dwMemoryLoad() As Long
  44.     dwMemoryLoad = iMemoryStatus.dwMemoryLoad
  45. End Property
  46.  
  47. Public Property Let dwMemoryLoad(vNewValue As Long)
  48.     iMemoryStatus.dwMemoryLoad = vNewValue
  49. End Property
  50.  
  51. Public Property Get dwTotalPhys() As Long
  52.     dwTotalPhys = iMemoryStatus.dwTotalPhys
  53. End Property
  54.  
  55. Public Property Let dwTotalPhys(vNewValue As Long)
  56.     iMemoryStatus.dwTotalPhys = vNewValue
  57. End Property
  58.  
  59. Public Property Get dwAvailPhys() As Long
  60.     dwAvailPhys = iMemoryStatus.dwAvailPhys
  61. End Property
  62.  
  63. Public Property Let dwAvailPhys(vNewValue As Long)
  64.     iMemoryStatus.dwAvailPhys = vNewValue
  65. End Property
  66.  
  67. Public Property Get dwTotalPageFile() As Long
  68.     dwTotalPageFile = iMemoryStatus.dwTotalPageFile
  69. End Property
  70.  
  71. Public Property Let dwTotalPageFile(vNewValue As Long)
  72.     iMemoryStatus.dwTotalPageFile = vNewValue
  73. End Property
  74.  
  75. Public Property Get dwAvailPageFile() As Long
  76.     dwAvailPageFile = iMemoryStatus.dwAvailPageFile
  77. End Property
  78.  
  79. Public Property Let dwAvailPageFile(vNewValue As Long)
  80.     iMemoryStatus.dwAvailPageFile = vNewValue
  81. End Property
  82.  
  83. Public Property Get dwTotalVirtual() As Long
  84.     dwTotalVirtual = iMemoryStatus.dwTotalVirtual
  85. End Property
  86.  
  87. Public Property Let dwTotalVirtual(vNewValue As Long)
  88.     iMemoryStatus.dwTotalVirtual = vNewValue
  89. End Property
  90.  
  91. Public Property Get dwAvailVirtual() As Long
  92.     dwAvailVirtual = iMemoryStatus.dwAvailVirtual
  93. End Property
  94.  
  95. Public Property Let dwAvailVirtual(vNewValue As Long)
  96.     iMemoryStatus.dwAvailVirtual = vNewValue
  97. End Property
  98.  
  99. #End If ' this class only exists in win32
  100.