home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_BAS / PWBROW.ZIP / BROWSE.FRM < prev    next >
Text File  |  1994-01-27  |  9KB  |  264 lines

  1. VERSION 2.00
  2. Begin Form frmBrowse 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "WINDOWS Magazine Version Browser"
  6.    ClientHeight    =   3495
  7.    ClientLeft      =   2880
  8.    ClientTop       =   2775
  9.    ClientWidth     =   6900
  10.    Height          =   4245
  11.    Icon            =   BROWSE.FRX:0000
  12.    Left            =   2790
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   3495
  16.    ScaleWidth      =   6900
  17.    Top             =   2115
  18.    Width           =   7080
  19.    Begin TextBox tbName 
  20.       Height          =   285
  21.       Left            =   240
  22.       TabIndex        =   1
  23.       Text            =   "tbName"
  24.       Top             =   480
  25.       Width           =   3135
  26.    End
  27.    Begin ComboBox cbTypes 
  28.       Height          =   300
  29.       Left            =   240
  30.       Style           =   2  'Dropdown List
  31.       TabIndex        =   7
  32.       Top             =   3000
  33.       Width           =   3135
  34.    End
  35.    Begin FileListBox filBrowse 
  36.       Height          =   1590
  37.       Left            =   240
  38.       MultiSelect     =   2  'Extended
  39.       TabIndex        =   2
  40.       Top             =   960
  41.       Width           =   3135
  42.    End
  43.    Begin DirListBox dirBrowse 
  44.       Height          =   1830
  45.       Left            =   3600
  46.       TabIndex        =   5
  47.       Top             =   720
  48.       Width           =   3135
  49.    End
  50.    Begin DriveListBox drvBrowse 
  51.       Height          =   315
  52.       Left            =   3600
  53.       TabIndex        =   8
  54.       Top             =   3000
  55.       Width           =   3135
  56.    End
  57.    Begin Label Label12 
  58.       BackStyle       =   0  'Transparent
  59.       Caption         =   "Dri&ves:"
  60.       Height          =   255
  61.       Left            =   3600
  62.       TabIndex        =   6
  63.       Top             =   2760
  64.       Width           =   1095
  65.    End
  66.    Begin Label Label3 
  67.       BackStyle       =   0  'Transparent
  68.       Caption         =   "List Files of &Type:"
  69.       Height          =   255
  70.       Left            =   240
  71.       TabIndex        =   3
  72.       Top             =   2760
  73.       Width           =   1815
  74.    End
  75.    Begin Label lblCurDir 
  76.       BackStyle       =   0  'Transparent
  77.       Caption         =   "lblCurDir"
  78.       Height          =   255
  79.       Left            =   3600
  80.       TabIndex        =   9
  81.       Top             =   480
  82.       Width           =   3135
  83.    End
  84.    Begin Label Label2 
  85.       BackStyle       =   0  'Transparent
  86.       Caption         =   "&Directories:"
  87.       Height          =   255
  88.       Left            =   3600
  89.       TabIndex        =   4
  90.       Top             =   240
  91.       Width           =   1335
  92.    End
  93.    Begin Label Label1 
  94.       BackStyle       =   0  'Transparent
  95.       Caption         =   "File &Name:"
  96.       Height          =   255
  97.       Left            =   240
  98.       TabIndex        =   0
  99.       Top             =   240
  100.       Width           =   975
  101.    End
  102.    Begin Menu mnuFile 
  103.       Caption         =   "&File"
  104.       Begin Menu mnuFilePrint 
  105.          Caption         =   "&Print ..."
  106.          Shortcut        =   ^P
  107.       End
  108.       Begin Menu mnuFileSep 
  109.          Caption         =   "-"
  110.       End
  111.       Begin Menu mnuFileExit 
  112.          Caption         =   "E&xit"
  113.       End
  114.    End
  115.    Begin Menu mnuHelp 
  116.       Caption         =   "&Help"
  117.       Begin Menu mnuHelpAbout 
  118.          Caption         =   "&About ..."
  119.          WindowList      =   -1  'True
  120.       End
  121.    End
  122. End
  123.  
  124. Sub cbTypes_Click ()
  125.     Dim Pat As String
  126.     Dim l, r As Integer
  127.  
  128.     Pat = cbTypes.List(cbTypes.ListIndex)
  129.     l = InStr(Pat, "(") + 1
  130.     r = InStr(l, Pat, ")")
  131.     filBrowse.Pattern = Mid$(Pat, l, r - l)
  132.     tbName.Text = filBrowse.Pattern
  133. End Sub
  134.  
  135. Sub dirBrowse_Change ()
  136.     lblCurDir.Caption = dirBrowse.List(dirBrowse.ListIndex)
  137.     filBrowse.Path = dirBrowse.Path
  138. End Sub
  139.  
  140. Sub drvBrowse_Change ()
  141.     dirBrowse.Path = drvBrowse.Drive
  142. End Sub
  143.  
  144. Sub filBrowse_DblClick ()
  145.     Dim FullName As String
  146.     Dim Result As Integer
  147.     Dim VI As VerInfo
  148.  
  149.     ' Thanks to Avi Stein 70313,246
  150.     If Len(filBrowse.Path) = 3 Then ' root directory (i.e. C:\)
  151.         FullName = filBrowse.Path + filBrowse.List(filBrowse.ListIndex)
  152.     Else
  153.         FullName = filBrowse.Path + "\" + filBrowse.List(filBrowse.ListIndex)
  154.     End If
  155.     frmDisp!lblName.Caption = FullName
  156.     frmDisp!lblSize.Caption = Format$(FileLen(FullName), "###,###,###,##0 \b\y\t\e\s")
  157.     frmDisp!lblDate.Caption = Format$(FileDateTime(FullName), "dddd, mmmm d, yyyy \a\t h:mm AM/PM")
  158.     
  159.     Result = GetFileVersion(FullName, VI)
  160.     frmDisp!lblFileVersion.Caption = VI.FileVersion
  161.     frmDisp!lblFileDescription.Caption = VI.FileDescription
  162.     frmDisp!lblCompanyName.Caption = VI.CompanyName
  163.     frmDisp!lblLanguage.Caption = VI.Language
  164.     frmDisp!lblComments.Caption = VI.Comments
  165.     frmDisp!lblOriginalFileName.Caption = VI.OriginalFileName
  166.     frmDisp!lblInternalName.Caption = VI.InternalName
  167.     frmDisp!lblCopyright.Caption = VI.LegalCopyright
  168.     frmDisp!lblTrademarks.Caption = VI.LegalTrademarks
  169.     frmDisp!lblProductName.Caption = VI.ProductName
  170.     frmDisp!lblProductVersion.Caption = VI.ProductVersion
  171.     frmDisp!lblPrivateBuild.Caption = VI.PrivateBuild
  172.     frmDisp!lblSpecialBuild.Caption = VI.SpecialBuild
  173.     frmDisp.Show 0
  174. End Sub
  175.  
  176. Sub Form_Load ()
  177.     Dim Default As Integer
  178.     Dim Result As Integer
  179.     
  180.     ' Load choices into File Type Dropdown list box
  181.     cbTypes.AddItem "All Executables (*.EXE;*.DLL;*.DRV;*.VBX;*.SCR;*.CPL;*.286;*.386;*.2GR;*.3GR;*.FOT;*.FON)"
  182.     cbTypes.AddItem "EXEs (*.EXE)"
  183.     cbTypes.AddItem "DLLs (*.DLL)"
  184.     cbTypes.AddItem "Drivers (*.DRV)"
  185.     cbTypes.AddItem "VB eXtensions (*.VBX)"
  186.     cbTypes.AddItem "ScreenSavers (*.SCR)"
  187.     cbTypes.AddItem "Control Panel Applet (*.CPL)"
  188.     cbTypes.AddItem "Standard Mode Driver (*.286)"
  189.     cbTypes.AddItem "Enhanced Mode Driver (*.386)"
  190.     cbTypes.AddItem "Standard Mode Grabber (*.2GR)"
  191.     cbTypes.AddItem "Enhanced Mode Grabber (*.3GR)"
  192.     cbTypes.AddItem "TrueType Fonts (*.FOT)"
  193.     cbTypes.AddItem "Other Fonts (*.FON)"
  194.     cbTypes.ListIndex = 0 ' set default to All Executables
  195.  
  196.     lblCurDir.Caption = dirBrowse.List(dirBrowse.ListIndex)
  197.  
  198.     ' move forms to position they had at end of last run
  199.     Default = (Screen.Height - frmBrowse.Height) / 2
  200.     Result = GetPrivateProfileInt("VerBrowse", "Top", Default, "WINMAG.INI")
  201.     BrowseTop = Result
  202.     frmBrowse.Top = BrowseTop
  203.     Default = (Screen.Width - frmBrowse.Width) / 2
  204.     Result = GetPrivateProfileInt("VerBrowse", "Left", Default, "WINMAG.INI")
  205.     BrowseLeft = Result
  206.     frmBrowse.Left = BrowseLeft
  207.     
  208.     Default = (Screen.Height - frmDisp.Height) / 2
  209.     Result = GetPrivateProfileInt("VerDisp", "Top", Default, "WINMAG.INI")
  210.     DispTop = Result
  211.     frmDisp.Top = DispTop
  212.     Default = (Screen.Width - frmDisp.Width) / 2
  213.     Result = GetPrivateProfileInt("VerDisp", "Left", Default, "WINMAG.INI")
  214.     DispLeft = Result
  215.     frmDisp.Left = DispLeft
  216.     
  217.     Default = (Screen.Height - frmPrint.Height) / 2
  218.     Result = GetPrivateProfileInt("VerPrint", "Top", Default, "WINMAG.INI")
  219.     PrintTop = Result
  220.     frmPrint.Top = PrintTop
  221.     Default = (Screen.Width - frmPrint.Width) / 2
  222.     Result = GetPrivateProfileInt("VerPrint", "Left", Default, "WINMAG.INI")
  223.     PrintLeft = Result
  224.     frmPrint.Left = PrintLeft
  225. End Sub
  226.  
  227. Sub Form_Unload (Cancel As Integer)
  228.     Unload frmDisp
  229.     Unload frmPrint
  230.  
  231.     If frmBrowse.WindowState <> 1 Then
  232.         ' window not minimized
  233.         BrowseTop = frmBrowse.Top
  234.         BrowseLeft = frmBrowse.Left
  235.     End If
  236.  
  237.     ' save the form position for next time
  238.     Result = WritePrivateProfileString("VerBrowse", "Top", Format$(BrowseTop), "WINMAG.INI")
  239.     Result = WritePrivateProfileString("VerBrowse", "Left", Format$(BrowseLeft), "WINMAG.INI")
  240.     Result = WritePrivateProfileString("VerDisp", "Top", Format$(DispTop), "WINMAG.INI")
  241.     Result = WritePrivateProfileString("VerDisp", "Left", Format$(DispLeft), "WINMAG.INI")
  242.     Result = WritePrivateProfileString("VerPrint", "Top", Format$(PrintTop), "WINMAG.INI")
  243.     Result = WritePrivateProfileString("VerPrint", "Left", Format$(PrintLeft), "WINMAG.INI")
  244.     End
  245. End Sub
  246.  
  247. Sub MnuFileExit_Click ()
  248.     Unload frmBrowse
  249. End Sub
  250.  
  251. Sub MnuFilePrint_Click ()
  252.     frmPrint.Show 1 ' modal
  253. End Sub
  254.  
  255. Sub mnuHelpAbout_Click ()
  256.     frmAbout.Show 1 ' show About box, wait till it exits
  257. End Sub
  258.  
  259. Sub tbName_Change ()
  260.     On Error Resume Next ' so we can stuff incomplete info into .Pattern
  261.     filBrowse.Pattern = tbName.Text
  262. End Sub
  263.  
  264.