home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Object = "{60CC5D62-2D08-11D0-BDBE-00AA00575603}#1.0#0"; "SysTray.ocx" Begin VB.Form frmGraph BackColor = &H00000000& BorderStyle = 1 'Fixed Single Caption = "Mem Viewer Version 3" ClientHeight = 1950 ClientLeft = 45 ClientTop = 330 ClientWidth = 4680 ControlBox = 0 'False Icon = "frmGraph.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 130 ScaleMode = 3 'Pixel ScaleWidth = 312 ShowInTaskbar = 0 'False StartUpPosition = 2 'CenterScreen Visible = 0 'False Begin SysTrayCtl.cSysTray SysTray Left = 2280 Top = 1560 _ExtentX = 900 _ExtentY = 900 InTray = -1 'True TrayIcon = "frmGraph.frx":0442 TrayTip = "(GRAPH V3)" End Begin VB.Timer tmrUpdate Interval = 1000 Left = 2880 Top = 1680 End Begin VB.PictureBox Picture1 BackColor = &H00000000& Height = 1590 Left = 480 ScaleHeight = 102 ScaleMode = 3 'Pixel ScaleWidth = 277 TabIndex = 3 Top = 0 Width = 4215 Begin VB.PictureBox picGraph AutoRedraw = -1 'True BackColor = &H00000000& BorderStyle = 0 'None Height = 1500 Left = 3960 ScaleHeight = 100 ScaleMode = 3 'Pixel ScaleWidth = 10 TabIndex = 7 Top = 15 Width = 150 End End Begin VB.Label lblopt AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Minimize" ForeColor = &H0000FF00& Height = 195 Index = 3 Left = 1800 TabIndex = 11 Top = 1680 Width = 600 End Begin VB.Label lblCurrent AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "0%" ForeColor = &H00FFFF00& Height = 195 Index = 2 Left = 0 TabIndex = 10 ToolTipText = "Available Virtual" Top = 960 Width = 210 End Begin VB.Label lblCurrent AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "0%" ForeColor = &H0000FF00& Height = 195 Index = 1 Left = 0 TabIndex = 9 ToolTipText = "Available Physical" Top = 720 Width = 210 End Begin VB.Label lblPos Alignment = 1 'Right Justify AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Curr. Pos" ForeColor = &H0000FF00& Height = 195 Left = 3960 TabIndex = 8 Top = 1680 Width = 645 End Begin VB.Label lblopt BackStyle = 0 'Transparent Caption = "Quit" ForeColor = &H0000FF00& Height = 255 Index = 2 Left = 1320 TabIndex = 6 Top = 1680 Width = 615 End Begin VB.Label lblopt AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Save" ForeColor = &H0000FF00& Height = 195 Index = 1 Left = 720 TabIndex = 5 Top = 1680 Width = 375 End Begin VB.Label lblopt AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "View" ForeColor = &H0000FF00& Height = 195 Index = 0 Left = 120 TabIndex = 4 Top = 1680 Width = 345 End Begin VB.Label lblCurrent AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "0%" ForeColor = &H000000FF& Height = 195 Index = 0 Left = 0 TabIndex = 2 ToolTipText = "Memory Load" Top = 480 Width = 210 End Begin VB.Label lblmisc AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "0%" ForeColor = &H0000FF00& Height = 195 Index = 1 Left = 0 TabIndex = 1 Top = 1320 Width = 210 End Begin VB.Label lblmisc AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "100%" ForeColor = &H0000FF00& Height = 195 Index = 0 Left = 0 TabIndex = 0 Top = 0 Width = 390 End Attribute VB_Name = "frmGraph" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False 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 Dim lpInfoBuffer As MEMORYSTATUS Private Sub Form_Load() LOAD App.Path + "\GRAPH.DAT" 'Load the Old Graph frmGraph.picGraph.Line (Currpos, 0)-(Currpos, 100), RGB(255, 255, 255) picGraph.Line (Currpos, 0)-(Currpos, 100), RGB(255, 255, 255) 'Currpos = 1 End Sub Private Sub Form_Resize() On Error Resume Next 'Picture1.Width = Me.ScaleWidth - lblmisc(0).Width picGraph.Left = Picture1.ScaleWidth - picGraph.Width Me.Height = 2355 End Sub Private Sub lblOpt_Click(Index As Integer) Select Case Index Case 0 'VIEW frmView.picView.Width = picGraph.Width frmView.picView.Picture = picGraph.Image frmView.Show Case 1 'SAVE SAVE App.Path + "\graph.dat" 'Save the Graph (reloaded in Form_Load) Case 2 'QUIT X = MsgBox("Are You Sure that you want to quit?", vbYesNo, "Quit") If X = 6 Then p = MsgBox("Do You want to Save the Graph?", vbYesNo, "Save") If p = 6 Then SAVE App.Path + "\graph.dat" 'Save the Graph (reloaded in Form_Load) End If Unload Me End End If lblopt(2).ForeColor = RGB(0, 255, 0) Case 3 'MINIMIZE Me.Visible = False 'Unloading or minimizing does not work SysTray.InTray = True End Select End Sub Private Sub lblOpt_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Select Case Index Case 0 lblopt(0).ForeColor = RGB(255, 0, 0) Case 1 lblopt(1).ForeColor = RGB(255, 0, 0) Case 2 lblopt(2).ForeColor = RGB(255, 0, 0) End Select End Sub Private Sub lblOpt_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) If Index = 1 Then lblopt(0).ForeColor = RGB(0, 255, 0) End If End Sub Private Sub SysTray_MouseDblClick(Button As Integer, Id As Long) frmGraph.Visible = False End Sub Private Sub SysTray_MouseDown(Button As Integer, Id As Long) frmGraph.Visible = True End Sub Private Sub tmrUpdate_Timer() If Currpos < 32767 Then 'Make sure that it doesn't go out of bounds of INTEGER Data type picGraph.Left = picGraph.Left - 1 picGraph.Width = picGraph.Width + 1 Currpos = Currpos + 1 lblPos.Caption = "Curr. Pos=" & Currpos lpInfoBuffer.dwLength = Len(lpInfoBuffer) GlobalMemoryStatus lpInfoBuffer MemPC = lpInfoBuffer.dwMemoryLoad PhysPC = Int((lpInfoBuffer.dwAvailPhys / lpInfoBuffer.dwTotalPhys) * 100) VirtPC = Int((lpInfoBuffer.dwAvailVirtual / lpInfoBuffer.dwTotalVirtual) * 100) lblCurrent(0) = MemPC & "%" lblCurrent(1) = PhysPC & "%" lblCurrent(2) = VirtPC & "%" MemLoad(Currpos) = MemPC Phys(Currpos) = PhysPC Virt(Currpos) = VirtPC picGraph.Line (Currpos - 1, 100 - MemLoad(Currpos - 1))-(Currpos, 100 - MemLoad(Currpos)), RGB(255, 0, 0) picGraph.Line (Currpos - 1, 100 - Phys(Currpos - 1))-(Currpos, 100 - Phys(Currpos)), RGB(0, 255, 0) picGraph.Line (Currpos - 1, 100 - Virt(Currpos - 1))-(Currpos, 100 - Virt(Currpos)), RGB(0, 255, 255) SysTray.TrayTip = "Mem Load=" & MemPC & "%, " & "Phys Load=" & PhysPC & "%, " & "Virt Load=" & VirtPC & "%" MsgBox "The Graph consists of too much data (more than 32767 entries). Please Close the Program and start again." & Chr$(13) & " If troubles persist, delete the file: " & App.Path + "\Graph.Dat", vbInformation, "Error" End If End Sub