home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD8554832000.psc / frmAbout.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-08-03  |  13.9 KB  |  333 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAbout 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "About MyApp"
  5.    ClientHeight    =   3555
  6.    ClientLeft      =   2340
  7.    ClientTop       =   1935
  8.    ClientWidth     =   5730
  9.    ClipControls    =   0   'False
  10.    Icon            =   "frmAbout.frx":0000
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   2453.724
  15.    ScaleMode       =   0  'User
  16.    ScaleWidth      =   5380.766
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   1  'CenterOwner
  19.    Begin VB.PictureBox picIcon 
  20.       Appearance      =   0  'Flat
  21.       AutoSize        =   -1  'True
  22.       BorderStyle     =   0  'None
  23.       ClipControls    =   0   'False
  24.       ForeColor       =   &H80000008&
  25.       Height          =   480
  26.       Left            =   480
  27.       Picture         =   "frmAbout.frx":0442
  28.       ScaleHeight     =   337.12
  29.       ScaleMode       =   0  'User
  30.       ScaleWidth      =   337.12
  31.       TabIndex        =   1
  32.       Top             =   240
  33.       Width           =   480
  34.    End
  35.    Begin VB.CommandButton cmdOK 
  36.       Cancel          =   -1  'True
  37.       Caption         =   "OK"
  38.       Default         =   -1  'True
  39.       Height          =   345
  40.       Left            =   4245
  41.       TabIndex        =   0
  42.       Top             =   2505
  43.       Width           =   1260
  44.    End
  45.    Begin VB.CommandButton cmdSysInfo 
  46.       Caption         =   "&System Info..."
  47.       Height          =   345
  48.       Left            =   4260
  49.       TabIndex        =   2
  50.       Top             =   2955
  51.       Width           =   1245
  52.    End
  53.    Begin VB.Label lblPostLink 
  54.       Caption         =   "postLink"
  55.       BeginProperty Font 
  56.          Name            =   "Tahoma"
  57.          Size            =   9.75
  58.          Charset         =   0
  59.          Weight          =   400
  60.          Underline       =   -1  'True
  61.          Italic          =   0   'False
  62.          Strikethrough   =   0   'False
  63.       EndProperty
  64.       ForeColor       =   &H00FF0000&
  65.       Height          =   285
  66.       Left            =   4320
  67.       TabIndex        =   9
  68.       ToolTipText     =   "Open PlanetSoureCode with links to my other submissions"
  69.       Top             =   1080
  70.       Width           =   1125
  71.    End
  72.    Begin VB.Label lblDescription2 
  73.       Caption         =   "App Description"
  74.       BeginProperty Font 
  75.          Name            =   "Tahoma"
  76.          Size            =   9.75
  77.          Charset         =   0
  78.          Weight          =   400
  79.          Underline       =   0   'False
  80.          Italic          =   0   'False
  81.          Strikethrough   =   0   'False
  82.       EndProperty
  83.       ForeColor       =   &H00000000&
  84.       Height          =   690
  85.       Left            =   1680
  86.       TabIndex        =   8
  87.       Top             =   1320
  88.       Width           =   3765
  89.    End
  90.    Begin VB.Label Label1 
  91.       Alignment       =   2  'Center
  92.       Caption         =   "Mail the Developer"
  93.       BeginProperty Font 
  94.          Name            =   "Tahoma"
  95.          Size            =   6.75
  96.          Charset         =   0
  97.          Weight          =   400
  98.          Underline       =   -1  'True
  99.          Italic          =   0   'False
  100.          Strikethrough   =   0   'False
  101.       EndProperty
  102.       ForeColor       =   &H00FF0000&
  103.       Height          =   375
  104.       Index           =   1
  105.       Left            =   240
  106.       TabIndex        =   7
  107.       ToolTipText     =   "Email the developer"
  108.       Top             =   1560
  109.       Width           =   975
  110.    End
  111.    Begin VB.Label Label1 
  112.       Alignment       =   2  'Center
  113.       Caption         =   "Developer's Homepage"
  114.       BeginProperty Font 
  115.          Name            =   "Tahoma"
  116.          Size            =   6.75
  117.          Charset         =   0
  118.          Weight          =   400
  119.          Underline       =   -1  'True
  120.          Italic          =   0   'False
  121.          Strikethrough   =   0   'False
  122.       EndProperty
  123.       ForeColor       =   &H00FF0000&
  124.       Height          =   375
  125.       Index           =   0
  126.       Left            =   240
  127.       TabIndex        =   6
  128.       ToolTipText     =   "Opens the developer's homepage in your default browser "
  129.       Top             =   1080
  130.       Width           =   975
  131.    End
  132.    Begin VB.Line Line1 
  133.       BorderColor     =   &H00808080&
  134.       BorderStyle     =   6  'Inside Solid
  135.       Index           =   1
  136.       X1              =   84.515
  137.       X2              =   5309.398
  138.       Y1              =   1604.756
  139.       Y2              =   1604.756
  140.    End
  141.    Begin VB.Label lblDescription 
  142.       Caption         =   "App Description"
  143.       BeginProperty Font 
  144.          Name            =   "Tahoma"
  145.          Size            =   9.75
  146.          Charset         =   0
  147.          Weight          =   400
  148.          Underline       =   0   'False
  149.          Italic          =   0   'False
  150.          Strikethrough   =   0   'False
  151.       EndProperty
  152.       ForeColor       =   &H00000000&
  153.       Height          =   330
  154.       Left            =   1680
  155.       TabIndex        =   3
  156.       Top             =   1080
  157.       Width           =   2685
  158.    End
  159.    Begin VB.Label lblTitle 
  160.       BeginProperty Font 
  161.          Name            =   "Tahoma"
  162.          Size            =   12
  163.          Charset         =   0
  164.          Weight          =   700
  165.          Underline       =   0   'False
  166.          Italic          =   0   'False
  167.          Strikethrough   =   0   'False
  168.       EndProperty
  169.       ForeColor       =   &H00000000&
  170.       Height          =   720
  171.       Left            =   1680
  172.       TabIndex        =   5
  173.       Top             =   240
  174.       Width           =   3885
  175.    End
  176.    Begin VB.Line Line1 
  177.       BorderColor     =   &H00FFFFFF&
  178.       BorderWidth     =   2
  179.       Index           =   0
  180.       X1              =   98.6
  181.       X2              =   5309.398
  182.       Y1              =   1615.11
  183.       Y2              =   1615.11
  184.    End
  185.    Begin VB.Label lblDisclaimer 
  186.       Caption         =   "Warning: ..."
  187.       BeginProperty Font 
  188.          Name            =   "Tahoma"
  189.          Size            =   6.75
  190.          Charset         =   0
  191.          Weight          =   400
  192.          Underline       =   0   'False
  193.          Italic          =   0   'False
  194.          Strikethrough   =   0   'False
  195.       EndProperty
  196.       ForeColor       =   &H00000000&
  197.       Height          =   840
  198.       Left            =   255
  199.       TabIndex        =   4
  200.       Top             =   2610
  201.       Width           =   3870
  202.    End
  203. Attribute VB_Name = "frmAbout"
  204. Attribute VB_GlobalNameSpace = False
  205. Attribute VB_Creatable = False
  206. Attribute VB_PredeclaredId = True
  207. Attribute VB_Exposed = False
  208. Option Explicit
  209. ' Reg Key Security Options...
  210. Const READ_CONTROL = &H20000
  211. Const KEY_QUERY_VALUE = &H1
  212. Const KEY_SET_VALUE = &H2
  213. Const KEY_CREATE_SUB_KEY = &H4
  214. Const KEY_ENUMERATE_SUB_KEYS = &H8
  215. Const KEY_NOTIFY = &H10
  216. Const KEY_CREATE_LINK = &H20
  217. Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
  218.                        KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
  219.                        KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL
  220.                      
  221. ' Reg Key ROOT Types...
  222. Const HKEY_LOCAL_MACHINE = &H80000002
  223. Const ERROR_SUCCESS = 0
  224. Const REG_SZ = 1                         ' Unicode nul terminated string
  225. Const REG_DWORD = 4                      ' 32-bit number
  226. Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
  227. Const gREGVALSYSINFOLOC = "MSINFO"
  228. Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
  229. Const gREGVALSYSINFO = "PATH"
  230. Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long
  231. Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
  232. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  233. Dim ret&
  234. Private Sub cmdSysInfo_Click()
  235.   Call StartSysInfo
  236. End Sub
  237. Private Sub cmdOK_Click()
  238.   Unload Me
  239. End Sub
  240. Private Sub Form_Load()
  241.             
  242.     Me.Caption = "About the Basic FileInfo Viewer"
  243.     lblTitle.Caption = "Basic File Information viewer"
  244.     Me.lblDescription.Caption = "Enhancements to the original "
  245.     Me.lblDescription2.Caption = "to PlanetSourcecode showing File Scripting Object activity and Listview Control."
  246.     Me.lblPostLink.Caption = "posting"
  247.     Me.lblDisclaimer.Caption = "Warning this application is offered for use 'AS IS'. The developer accepts no responsibility for damage or loss of data to host PC's during it's running. If you don't trust me, run the sourcecode in debug mode first rather than the .exe?!"
  248.                    
  249. End Sub
  250. Public Sub StartSysInfo()
  251.     On Error GoTo SysInfoErr
  252.     Dim rc As Long
  253.     Dim SysInfoPath As String
  254.     ' Try To Get System Info Program Path\Name From Registry...
  255.     If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
  256.     ' Try To Get System Info Program Path Only From Registry...
  257.     ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
  258.         ' Validate Existance Of Known 32 Bit File Version
  259.         If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
  260.             SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
  261.             
  262.         ' Error - File Can Not Be Found...
  263.         Else
  264.             GoTo SysInfoErr
  265.         End If
  266.     ' Error - Registry Entry Can Not Be Found...
  267.     Else
  268.         GoTo SysInfoErr
  269.     End If
  270.     Call Shell(SysInfoPath, vbNormalFocus)
  271.     Exit Sub
  272. SysInfoErr:
  273.     MsgBox "System Information Is Unavailable At This Time", vbOKOnly
  274. End Sub
  275. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
  276.     Dim i As Long                                           ' Loop Counter
  277.     Dim rc As Long                                          ' Return Code
  278.     Dim hKey As Long                                        ' Handle To An Open Registry Key
  279.     Dim hDepth As Long                                      '
  280.     Dim KeyValType As Long                                  ' Data Type Of A Registry Key
  281.     Dim tmpVal As String                                    ' Tempory Storage For A Registry Key Value
  282.     Dim KeyValSize As Long                                  ' Size Of Registry Key Variable
  283.     '------------------------------------------------------------
  284.     ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
  285.     '------------------------------------------------------------
  286.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
  287.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Error...
  288.     tmpVal = String$(1024, 0)                             ' Allocate Variable Space
  289.     KeyValSize = 1024                                       ' Mark Variable Size
  290.     '------------------------------------------------------------
  291.     ' Retrieve Registry Key Value...
  292.     '------------------------------------------------------------
  293.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
  294.                          KeyValType, tmpVal, KeyValSize)    ' Get/Create Key Value
  295.                         
  296.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Errors
  297.     If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then           ' Win95 Adds Null Terminated String...
  298.         tmpVal = Left(tmpVal, KeyValSize - 1)               ' Null Found, Extract From String
  299.     Else                                                    ' WinNT Does NOT Null Terminate String...
  300.         tmpVal = Left(tmpVal, KeyValSize)                   ' Null Not Found, Extract String Only
  301.     End If
  302.     '------------------------------------------------------------
  303.     ' Determine Key Value Type For Conversion...
  304.     '------------------------------------------------------------
  305.     Select Case KeyValType                                  ' Search Data Types...
  306.     Case REG_SZ                                             ' String Registry Key Data Type
  307.         KeyVal = tmpVal                                     ' Copy String Value
  308.     Case REG_DWORD                                          ' Double Word Registry Key Data Type
  309.         For i = Len(tmpVal) To 1 Step -1                    ' Convert Each Bit
  310.             KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1)))   ' Build Value Char. By Char.
  311.         Next
  312.         KeyVal = Format$("&h" + KeyVal)                     ' Convert Double Word To String
  313.     End Select
  314.     GetKeyValue = True                                      ' Return Success
  315.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  316.     Exit Function                                           ' Exit
  317. GetKeyError:      ' Cleanup After An Error Has Occured...
  318.     KeyVal = ""                                             ' Set Return Val To Empty String
  319.     GetKeyValue = False                                     ' Return Failure
  320.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  321. End Function
  322. Private Sub Label1_Click(Index As Integer)
  323.     Select Case Index
  324.         Case 0
  325.             ret& = ShellExecute(Me.hWnd, "Open", "http://www.boardmad.com", "", App.Path, 1)
  326.         Case 1
  327.             ret& = ShellExecute(Me.hWnd, "Open", "mailto:scott@boardmad.com", "", App.Path, 1)
  328.     End Select
  329. End Sub
  330. Private Sub lblPostLink_Click()
  331.     ret& = ShellExecute(Me.hWnd, "Open", "http://www.planetsourcecode.com/vb/scripts/BrowseCategoryOrSearchResults.asp?txtCriteria=scott+brown&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE&lngWId=1&optSort=Alphabetical", "", App.Path, 1)
  332. End Sub
  333.