home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / odo_src / odometer.frm < prev    next >
Text File  |  1994-02-06  |  8KB  |  276 lines

  1. VERSION 2.00
  2. Begin Form Resource 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   0  'None
  5.    ClientHeight    =   1020
  6.    ClientLeft      =   1200
  7.    ClientTop       =   3420
  8.    ClientWidth     =   9990
  9.    ClipControls    =   0   'False
  10.    ControlBox      =   0   'False
  11.    Height          =   1515
  12.    Icon            =   ODOMETER.FRX:0000
  13.    Left            =   1095
  14.    LinkMode        =   1  'Source
  15.    LinkTopic       =   "Form2"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   1020
  19.    ScaleWidth      =   9990
  20.    Top             =   3030
  21.    Width           =   10200
  22.    Begin Timer CaptionTimer 
  23.       Interval        =   5000
  24.       Left            =   1560
  25.       Top             =   660
  26.    End
  27.    Begin PictureClip PicClip1 
  28.       Cols            =   20
  29.       Location        =   "7200,3300,1440,180"
  30.       Picture         =   ODOMETER.FRX:0302
  31.       Rows            =   10
  32.    End
  33.    Begin SSPanel Panel3D1 
  34.       Alignment       =   1  'Left Justify - MIDDLE
  35.       BevelInner      =   1  'Inset
  36.       BevelWidth      =   2
  37.       Caption         =   "       Sys              GDI             User              Mem                    k   C:                      k  D:                      k"
  38.       ForeColor       =   &H00000000&
  39.       Height          =   555
  40.       Left            =   0
  41.       TabIndex        =   0
  42.       Top             =   0
  43.       Width           =   9990
  44.       Begin Counter Counter6 
  45.          BackColorRight  =   &H000000FF&
  46.          DigitsLeft      =   6
  47.          DigitsRight     =   1
  48.          ForeColorRight  =   &H8000000E&
  49.          Height          =   255
  50.          Left            =   7800
  51.          Top             =   150
  52.          Value           =   0
  53.          Width           =   1275
  54.       End
  55.       Begin PictureBox Picture2 
  56.          AutoSize        =   -1  'True
  57.          BackColor       =   &H00C0C0C0&
  58.          BorderStyle     =   0  'None
  59.          Height          =   240
  60.          Left            =   9510
  61.          ScaleHeight     =   240
  62.          ScaleWidth      =   255
  63.          TabIndex        =   2
  64.          Top             =   105
  65.          Width           =   255
  66.       End
  67.       Begin PictureBox Picture1 
  68.          AutoSize        =   -1  'True
  69.          BackColor       =   &H00C0C0C0&
  70.          BorderStyle     =   0  'None
  71.          Height          =   195
  72.          Left            =   90
  73.          ScaleHeight     =   195
  74.          ScaleWidth      =   255
  75.          TabIndex        =   1
  76.          Top             =   105
  77.          Width           =   255
  78.       End
  79.       Begin Counter Counter5 
  80.          BackColorRight  =   &H000000FF&
  81.          DigitsLeft      =   6
  82.          DigitsRight     =   1
  83.          ForeColorRight  =   &H8000000E&
  84.          Height          =   255
  85.          Left            =   6060
  86.          Top             =   150
  87.          Value           =   0
  88.          Width           =   1275
  89.       End
  90.       Begin Counter Counter4 
  91.          BackColorRight  =   &H000000FF&
  92.          DigitsLeft      =   5
  93.          DigitsRight     =   1
  94.          ForeColorRight  =   &H8000000E&
  95.          Height          =   255
  96.          Left            =   4470
  97.          Top             =   150
  98.          Value           =   0
  99.          Width           =   1095
  100.       End
  101.       Begin Counter Counter3 
  102.          BackColorRight  =   &H000000FF&
  103.          DigitsLeft      =   1
  104.          DigitsRight     =   2
  105.          ForeColorRight  =   &H8000000E&
  106.          Height          =   255
  107.          Left            =   3225
  108.          Top             =   150
  109.          Value           =   0
  110.          Width           =   495
  111.       End
  112.       Begin Counter Counter2 
  113.          BackColorRight  =   &H000000FF&
  114.          DigitsLeft      =   1
  115.          DigitsRight     =   2
  116.          ForeColorRight  =   &H8000000E&
  117.          Height          =   255
  118.          Left            =   2040
  119.          Top             =   150
  120.          Value           =   0
  121.          Width           =   495
  122.       End
  123.       Begin Counter Counter1 
  124.          BackColorRight  =   &H000000FF&
  125.          DigitsLeft      =   1
  126.          DigitsRight     =   2
  127.          ForeColorRight  =   &H8000000E&
  128.          Height          =   255
  129.          Left            =   870
  130.          Top             =   150
  131.          Value           =   0
  132.          Width           =   495
  133.       End
  134.    End
  135.    Begin Timer Mem_Timer 
  136.       Interval        =   10
  137.       Left            =   5100
  138.       Top             =   840
  139.    End
  140. End
  141. Sub CaptionTimer_Timer ()
  142.  
  143.        'set info in icon caption
  144.     If Resource.WindowState = 1 Then
  145.           Resource.Caption = "Sys = " & (SysReSrc * 100) & "% " & Format$((GetFreeSpace(&H0) / 1024 / 1024), "##.0") & " meg"
  146.           Else
  147.                Resource.Caption = ""
  148.           End If
  149.  
  150. End Sub
  151.  
  152. Sub Form_DblClick ()
  153.     'close
  154.     End
  155. End Sub
  156.  
  157. Sub Form_Load ()
  158.  
  159.     left = (Screen.Width / 2 - Width / 2)
  160.     top = (Screen.Height - Screen.Height + 25)
  161.     Height = 555
  162.      
  163.      picture1.Picture = PicClip1.GraphicCell(0)
  164.      picture2.Picture = PicClip1.GraphicCell(9)
  165.   
  166.      SetWindowPos Resource.hWnd, HWND_TOPMOST, 0, 0, 0, 0, &H40
  167.      SysReSrc = GetFreeSystemResources(GFSR_SYSTEMRESOURCES) / 100
  168.      Resource.Counter1.Value = SysReSrc
  169.      GdiReSrc = GetFreeSystemResources(GFSR_GDIRESOURCES) / 100
  170.      Resource.Counter2.Value = GdiReSrc
  171.      UserReSrc = GetFreeSystemResources(GFSR_USERRESOURCES) / 100
  172.      Resource.Counter3.Value = UserReSrc
  173.      Resource.Counter4.Value = GetFreeSpace(&H0) / 1024
  174.      
  175.      z% = 1  ' free space
  176.      Y% = 3  ' drive 0 is default drive drive A is 1 etc.
  177.      x& = DiskInfo&(Y%, z%)
  178.      Resource.Counter5.Value = x& / 1024
  179.  
  180.      z% = 1  ' free space
  181.      t% = 2 'total space
  182.      Y% = 4  ' drive 0 is default drive drive A is 1 etc.
  183.  
  184.      x& = DiskInfo&(Y%, z%)
  185.      If x& = -1 Then
  186.           CounterFlag = True
  187.           Panel3D1.Caption = "       Sys              GDI             User              Mem                    k   C:                      k  C:                      total"
  188.           Msg$ = "No Drive D: Detected."
  189.           MsgBox Msg$, 64, "OdoMeter v1.2"
  190.           w& = DiskInfo&(3, t%)
  191.           Resource.Counter6.Value = w& / 1024
  192.           Else
  193.                Resource.Counter6.Value = x& / 1024
  194.           End If
  195.  
  196. End Sub
  197.  
  198. Sub Label5_DblClick ()
  199.     End
  200. End Sub
  201.  
  202. Sub Label6_DblClick ()
  203.     End
  204. End Sub
  205.  
  206. Sub Label7_DblClick ()
  207.     End
  208. End Sub
  209.  
  210. Sub Label8_DblClick ()
  211.     End
  212. End Sub
  213.  
  214. Sub Mem_Timer_Timer ()
  215.  
  216.      ' Get system resources
  217.      SysReSrc = GetFreeSystemResources(GFSR_SYSTEMRESOURCES) / 100
  218.      Resource.Counter1.Value = SysReSrc
  219.      GdiReSrc = GetFreeSystemResources(GFSR_GDIRESOURCES) / 100
  220.      Resource.Counter2.Value = GdiReSrc
  221.      UserReSrc = GetFreeSystemResources(GFSR_USERRESOURCES) / 100
  222.      Resource.Counter3.Value = UserReSrc
  223.      Resource.Counter4.Value = GetFreeSpace(&H0) / 1024
  224.      
  225.      z% = 1  ' free space
  226.      Y% = 3  ' drive 0 is default drive drive A is 1 etc.
  227.      
  228.      x& = DiskInfo&(Y%, z%)
  229.      Resource.Counter5.Value = x& / 1024
  230.  
  231.      Y% = 4  ' drive 0 is default drive drive A is 1 etc.
  232.      t% = 2 'total space
  233.      If CounterFlag = True Then
  234.           w& = DiskInfo&(3, t%)
  235.           Resource.Counter6.Value = w& / 1024
  236.           ElseIf CounterFlag = False Then
  237.                x& = DiskInfo&(Y%, z%)
  238.                Resource.Counter6.Value = x& / 1024
  239.           End If
  240.  
  241. End Sub
  242.  
  243. Sub Picture1_Click ()
  244.      Unload Resource
  245. End Sub
  246.  
  247. Sub Picture1_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
  248.      picture1.Picture = PicClip1.GraphicCell(0 + 10)
  249.  
  250. End Sub
  251.  
  252. Sub Picture1_MouseUp (Button As Integer, Shift As Integer, x As Single, Y As Single)
  253.      
  254.      picture1.Picture = PicClip1.GraphicCell(0)
  255.  
  256. End Sub
  257.  
  258. Sub Picture2_Click ()
  259.      WindowState = 1
  260. End Sub
  261.  
  262. Sub Picture2_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
  263.      
  264.      picture2.Picture = PicClip1.GraphicCell(9 + 10)
  265.  
  266. End Sub
  267.  
  268. Sub Picture2_MouseUp (Button As Integer, Shift As Integer, x As Single, Y As Single)
  269.      
  270.      picture2.Picture = PicClip1.GraphicCell(9)
  271.  
  272. End Sub
  273.  
  274.  
  275.  
  276.