home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form MemStatusForm
- Caption = "Memory Status"
- ClientHeight = 4875
- ClientLeft = 60
- ClientTop = 330
- ClientWidth = 5070
- LinkTopic = "Form1"
- ScaleHeight = 4875
- ScaleWidth = 5070
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command1
- Caption = "Memory Status"
- BeginProperty Font
- Name = "Verdana"
- Size = 11.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 1080
- TabIndex = 14
- Top = 4140
- Width = 2895
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 7
- Left = 3015
- TabIndex = 16
- Top = 3600
- Width = 1560
- End
- Begin VB.Label Label1
- Caption = "Virtual Bytes in Use"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 15
- Left = 105
- TabIndex = 15
- Top = 3585
- Width = 2715
- End
- Begin VB.Label Label1
- Caption = "Free Virtual Bytes:"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 14
- Left = 120
- TabIndex = 13
- Top = 3120
- Width = 2715
- End
- Begin VB.Label Label1
- Caption = "Total Virtual Bytes:"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 13
- Left = 120
- TabIndex = 12
- Top = 2640
- Width = 2715
- End
- Begin VB.Label Label1
- Caption = "Paging File Free Bytes:"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 12
- Left = 120
- TabIndex = 11
- Top = 2160
- Width = 2715
- End
- Begin VB.Label Label1
- Caption = "Page File Bytes:"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 11
- Left = 120
- TabIndex = 10
- Top = 1680
- Width = 2715
- End
- Begin VB.Label Label1
- Caption = "Available Physical Bytes:"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 10
- Left = 120
- TabIndex = 9
- Top = 1200
- Width = 2715
- End
- Begin VB.Label Label1
- Caption = "Total Physical Bytes:"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 9
- Left = 120
- TabIndex = 8
- Top = 720
- Width = 2715
- End
- Begin VB.Label Label1
- Caption = "Percent of Memory in Use:"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 8
- Left = 120
- TabIndex = 7
- Top = 240
- Width = 2715
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 6
- Left = 3030
- TabIndex = 6
- Top = 3135
- Width = 1560
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 5
- Left = 3030
- TabIndex = 5
- Top = 2655
- Width = 1560
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 4
- Left = 3030
- TabIndex = 4
- Top = 2175
- Width = 1560
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 3
- Left = 3030
- TabIndex = 3
- Top = 1695
- Width = 1560
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 2
- Left = 3030
- TabIndex = 2
- Top = 1215
- Width = 1560
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 1
- Left = 3030
- TabIndex = 1
- Top = 735
- Width = 1560
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 0
- Left = 3030
- TabIndex = 0
- Top = 255
- Width = 1560
- End
- Attribute VB_Name = "MemStatusForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' ******************************
- ' ******************************
- ' ** MASTERING VB6 **
- ' ** by Evangelos Petroutos **
- ' ** SYBEX, 1998 **
- ' ******************************
- ' ******************************
- Option Explicit
- Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
- Private 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
- Private Sub Command1_Click()
- Dim memStat As MEMORYSTATUS
- memStat.dwLength = Len(memStat)
- Call GlobalMemoryStatus(memStat)
- Label1(0).Caption = Format(memStat.dwMemoryLoad, "###,###,###")
- Label1(1).Caption = Format(memStat.dwTotalPhys, "###,###,###")
- Label1(2).Caption = Format(memStat.dwAvailPhys, "###,###,###")
- Label1(3).Caption = Format(memStat.dwTotalPageFile, "###,###,###")
- Label1(4).Caption = Format(memStat.dwAvailPageFile, "###,###,###")
- Label1(5).Caption = Format(memStat.dwTotalVirtual, "###,###,###")
- Label1(6).Caption = Format(memStat.dwAvailVirtual, "###,###,###")
- Label1(7).Caption = Format(memStat.dwTotalVirtual - memStat.dwAvailVirtual, "###,###,###")
- End Sub
-