home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LVB / T2W32543.ZIP / _MEM.FRM < prev    next >
Text File  |  1998-05-21  |  5KB  |  185 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMem 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Memory status"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4845
  13.    ScaleWidth      =   7485
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   -90
  20.       Width           =   7485
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   7110
  26.          TabIndex        =   6
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   6210
  35.          TabIndex        =   5
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   6570
  44.          TabIndex        =   4
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   2
  52.          Top             =   180
  53.          Width           =   4755
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   3
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.Label lbl_Result 
  65.       Appearance      =   0  'Flat
  66.       BackColor       =   &H80000005&
  67.       BackStyle       =   0  'Transparent
  68.       ForeColor       =   &H80000008&
  69.       Height          =   4110
  70.       Left            =   90
  71.       TabIndex        =   0
  72.       Top             =   630
  73.       Width           =   7305
  74.    End
  75. End
  76. Attribute VB_Name = "frmMem"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Option Base 1
  83.  
  84. Private Const Iteration = 250
  85.  
  86. Dim IsLoaded         As Integer
  87.  
  88. Dim TimerStartOk     As Integer
  89. Dim TimerCloseOk     As Integer
  90.  
  91. Dim TimerHandle      As Integer
  92. Dim TimerValue       As Long
  93.  
  94. Private Sub cmdNP_Click(Index As Integer)
  95.  
  96.    Call sub_NextPrev(cmb_Function, Index)
  97.  
  98. End Sub
  99.  
  100.  
  101. Private Sub cmb_Function_Click()
  102.    
  103.    If (IsLoaded = False) Then Exit Sub
  104.    
  105.    Call cDisableFI(mdiT2W.Picture1)
  106.    
  107.    lbl_Result = ""
  108.    
  109.    DoEvents
  110.    
  111.    Select Case cmb_Function.ListIndex
  112.       Case 0
  113.          Call TestMemoryStatus
  114.    End Select
  115.  
  116.    DoEvents
  117.    Call cEnableFI(mdiT2W.Picture1)
  118.    
  119. End Sub
  120.  
  121.  
  122. Private Sub Form_Activate()
  123.  
  124.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  125.  
  126. End Sub
  127.  
  128. Private Sub Form_Load()
  129.  
  130.    IsLoaded = False
  131.    
  132.    Show
  133.  
  134.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_mem.t2w")
  135.    
  136.    IsLoaded = True
  137.    
  138. End Sub
  139.  
  140. Private Sub Command1_Click()
  141.    
  142.    Call cmb_Function_Click
  143.    
  144. End Sub
  145.  
  146. Private Sub TestMemoryStatus()
  147.  
  148.    Dim intResult        As Integer
  149.    Dim strResult        As String
  150.    Dim strDisplay       As String
  151.    
  152.    Dim i                As Integer
  153.    
  154.    Dim MSS              As tagMEMORYSTATUS
  155.    
  156.    strResult = ""
  157.    strDisplay = ""
  158.    
  159.    Call cMemoryStatus(MSS)
  160.    
  161.    strDisplay = strDisplay & "dwMemoryLoad = " & MSS.dwMemoryLoad & vbCrLf
  162.    strDisplay = strDisplay & "dwTotalPhys = " & MSS.dwTotalPhys & vbCrLf
  163.    strDisplay = strDisplay & "dwAvailPhys = " & MSS.dwAvailPhys & vbCrLf
  164.    strDisplay = strDisplay & "dwTotalPageFile = " & MSS.dwTotalPageFile & vbCrLf
  165.    strDisplay = strDisplay & "dwAvailPageFile = " & MSS.dwAvailPageFile & vbCrLf
  166.    strDisplay = strDisplay & "dwTotalVirtual = " & MSS.dwTotalVirtual & vbCrLf
  167.    strDisplay = strDisplay & "dwAvailVirtual = " & MSS.dwAvailVirtual & vbCrLf
  168.      
  169.    lbl_Result = strDisplay
  170.  
  171.    'time the function
  172.  
  173.    TimerHandle = cTimerOpen()
  174.    TimerStartOk = cTimerStart(TimerHandle)
  175.    
  176.    For i = 1 To Iteration
  177.       Call cMemoryStatus(MSS)
  178.    Next i
  179.    
  180.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  181.    
  182.    TimerCloseOk = cTimerClose(TimerHandle)
  183.  
  184. End Sub
  185.