home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / odo_src / odometer.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-02-06  |  8.1 KB  |  244 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. Sub CaptionTimer_Timer ()
  141.        'set info in icon caption
  142.     If Resource.WindowState = 1 Then
  143.           Resource.Caption = "Sys = " & (SysReSrc * 100) & "% " & Format$((GetFreeSpace(&H0) / 1024 / 1024), "##.0") & " meg"
  144.           Else
  145.                Resource.Caption = ""
  146.           End If
  147. End Sub
  148. Sub Form_DblClick ()
  149.     'close
  150. End Sub
  151. Sub Form_Load ()
  152.     left = (Screen.Width / 2 - Width / 2)
  153.     top = (Screen.Height - Screen.Height + 25)
  154.     Height = 555
  155.      
  156.      picture1.Picture = PicClip1.GraphicCell(0)
  157.      picture2.Picture = PicClip1.GraphicCell(9)
  158.      SetWindowPos Resource.hWnd, HWND_TOPMOST, 0, 0, 0, 0, &H40
  159.      SysReSrc = GetFreeSystemResources(GFSR_SYSTEMRESOURCES) / 100
  160.      Resource.Counter1.Value = SysReSrc
  161.      GdiReSrc = GetFreeSystemResources(GFSR_GDIRESOURCES) / 100
  162.      Resource.Counter2.Value = GdiReSrc
  163.      UserReSrc = GetFreeSystemResources(GFSR_USERRESOURCES) / 100
  164.      Resource.Counter3.Value = UserReSrc
  165.      Resource.Counter4.Value = GetFreeSpace(&H0) / 1024
  166.      
  167.      z% = 1  ' free space
  168.      Y% = 3  ' drive 0 is default drive drive A is 1 etc.
  169.      x& = DiskInfo&(Y%, z%)
  170.      Resource.Counter5.Value = x& / 1024
  171.      z% = 1  ' free space
  172.      t% = 2 'total space
  173.      Y% = 4  ' drive 0 is default drive drive A is 1 etc.
  174.      x& = DiskInfo&(Y%, z%)
  175.      If x& = -1 Then
  176.           CounterFlag = True
  177.           Panel3D1.Caption = "       Sys              GDI             User              Mem                    k   C:                      k  C:                      total"
  178.           Msg$ = "No Drive D: Detected."
  179.           MsgBox Msg$, 64, "OdoMeter v1.2"
  180.           w& = DiskInfo&(3, t%)
  181.           Resource.Counter6.Value = w& / 1024
  182.           Else
  183.                Resource.Counter6.Value = x& / 1024
  184.           End If
  185. End Sub
  186. Sub Label5_DblClick ()
  187.     End
  188. End Sub
  189. Sub Label6_DblClick ()
  190.     End
  191. End Sub
  192. Sub Label7_DblClick ()
  193.     End
  194. End Sub
  195. Sub Label8_DblClick ()
  196.     End
  197. End Sub
  198. Sub Mem_Timer_Timer ()
  199.      ' Get system resources
  200.      SysReSrc = GetFreeSystemResources(GFSR_SYSTEMRESOURCES) / 100
  201.      Resource.Counter1.Value = SysReSrc
  202.      GdiReSrc = GetFreeSystemResources(GFSR_GDIRESOURCES) / 100
  203.      Resource.Counter2.Value = GdiReSrc
  204.      UserReSrc = GetFreeSystemResources(GFSR_USERRESOURCES) / 100
  205.      Resource.Counter3.Value = UserReSrc
  206.      Resource.Counter4.Value = GetFreeSpace(&H0) / 1024
  207.      
  208.      z% = 1  ' free space
  209.      Y% = 3  ' drive 0 is default drive drive A is 1 etc.
  210.      
  211.      x& = DiskInfo&(Y%, z%)
  212.      Resource.Counter5.Value = x& / 1024
  213.      Y% = 4  ' drive 0 is default drive drive A is 1 etc.
  214.      t% = 2 'total space
  215.      If CounterFlag = True Then
  216.           w& = DiskInfo&(3, t%)
  217.           Resource.Counter6.Value = w& / 1024
  218.           ElseIf CounterFlag = False Then
  219.                x& = DiskInfo&(Y%, z%)
  220.                Resource.Counter6.Value = x& / 1024
  221.           End If
  222. End Sub
  223. Sub Picture1_Click ()
  224.      Unload Resource
  225. End Sub
  226. Sub Picture1_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
  227.      picture1.Picture = PicClip1.GraphicCell(0 + 10)
  228. End Sub
  229. Sub Picture1_MouseUp (Button As Integer, Shift As Integer, x As Single, Y As Single)
  230.      
  231.      picture1.Picture = PicClip1.GraphicCell(0)
  232. End Sub
  233. Sub Picture2_Click ()
  234.      WindowState = 1
  235. End Sub
  236. Sub Picture2_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
  237.      
  238.      picture2.Picture = PicClip1.GraphicCell(9 + 10)
  239. End Sub
  240. Sub Picture2_MouseUp (Button As Integer, Shift As Integer, x As Single, Y As Single)
  241.      
  242.      picture2.Picture = PicClip1.GraphicCell(9)
  243. End Sub
  244.