home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / techno2a / frmabout.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-25  |  12.2 KB  |  307 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAbout 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "About"
  5.    ClientHeight    =   3885
  6.    ClientLeft      =   2340
  7.    ClientTop       =   1935
  8.    ClientWidth     =   6015
  9.    ClipControls    =   0   'False
  10.    Icon            =   "frmAbout.frx":0000
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   2681.496
  15.    ScaleMode       =   0  'User
  16.    ScaleWidth      =   5648.396
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   2  'CenterScreen
  19.    Begin VB.Timer Timer2 
  20.       Interval        =   1
  21.       Left            =   120
  22.       Top             =   240
  23.    End
  24.    Begin VB.PictureBox Picture2 
  25.       AutoSize        =   -1  'True
  26.       ClipControls    =   0   'False
  27.       Height          =   540
  28.       Left            =   120
  29.       Picture         =   "frmAbout.frx":1CCA
  30.       ScaleHeight     =   337.12
  31.       ScaleMode       =   0  'User
  32.       ScaleWidth      =   337.12
  33.       TabIndex        =   9
  34.       Top             =   120
  35.       Visible         =   0   'False
  36.       Width           =   540
  37.    End
  38.    Begin VB.PictureBox Picture1 
  39.       AutoSize        =   -1  'True
  40.       ClipControls    =   0   'False
  41.       Height          =   540
  42.       Left            =   120
  43.       Picture         =   "frmAbout.frx":2594
  44.       ScaleHeight     =   337.12
  45.       ScaleMode       =   0  'User
  46.       ScaleWidth      =   337.12
  47.       TabIndex        =   8
  48.       Top             =   120
  49.       Visible         =   0   'False
  50.       Width           =   540
  51.    End
  52.    Begin VB.Timer Timer1 
  53.       Interval        =   2000
  54.       Left            =   120
  55.       Top             =   120
  56.    End
  57.    Begin VB.PictureBox picIcon 
  58.       AutoSize        =   -1  'True
  59.       ClipControls    =   0   'False
  60.       Height          =   540
  61.       Left            =   120
  62.       ScaleHeight     =   337.12
  63.       ScaleMode       =   0  'User
  64.       ScaleWidth      =   337.12
  65.       TabIndex        =   1
  66.       Top             =   120
  67.       Width           =   540
  68.    End
  69.    Begin VB.CommandButton cmdOK 
  70.       Cancel          =   -1  'True
  71.       Caption         =   "OK"
  72.       Default         =   -1  'True
  73.       Height          =   825
  74.       Left            =   4680
  75.       TabIndex        =   0
  76.       Top             =   2880
  77.       Width           =   1260
  78.    End
  79.    Begin VB.CommandButton cmdSysInfo 
  80.       Caption         =   "&System Info..."
  81.       Height          =   825
  82.       Left            =   3360
  83.       Picture         =   "frmAbout.frx":2E5E
  84.       Style           =   1  'Graphical
  85.       TabIndex        =   2
  86.       Top             =   2880
  87.       Width           =   1245
  88.    End
  89.    Begin VB.Label lblVersion 
  90.       Alignment       =   1  'Right Justify
  91.       Caption         =   "Vol. 2 October 1999"
  92.       Height          =   225
  93.       Left            =   4200
  94.       TabIndex        =   6
  95.       Top             =   480
  96.       Width           =   1605
  97.    End
  98.    Begin VB.Label Label1 
  99.       Caption         =   "Sponsors can contact us at:  Scottw68@Hotmail.com"
  100.       BeginProperty Font 
  101.          Name            =   "MS Sans Serif"
  102.          Size            =   9.75
  103.          Charset         =   0
  104.          Weight          =   400
  105.          Underline       =   0   'False
  106.          Italic          =   0   'False
  107.          Strikethrough   =   0   'False
  108.       EndProperty
  109.       ForeColor       =   &H00FF0000&
  110.       Height          =   255
  111.       Left            =   480
  112.       TabIndex        =   7
  113.       Top             =   2160
  114.       Width           =   4695
  115.    End
  116.    Begin VB.Line Line1 
  117.       BorderColor     =   &H00808080&
  118.       BorderStyle     =   6  'Inside Solid
  119.       Index           =   1
  120.       X1              =   0
  121.       X2              =   5634.31
  122.       Y1              =   1905.001
  123.       Y2              =   1905.001
  124.    End
  125.    Begin VB.Label lblDescription 
  126.       Alignment       =   2  'Center
  127.       Caption         =   $"frmAbout.frx":32A0
  128.       ForeColor       =   &H00000000&
  129.       Height          =   810
  130.       Left            =   720
  131.       TabIndex        =   3
  132.       Top             =   960
  133.       Width           =   4605
  134.    End
  135.    Begin VB.Label lblTitle 
  136.       Alignment       =   2  'Center
  137.       Caption         =   "Tech Notes "
  138.       BeginProperty Font 
  139.          Name            =   "MS Sans Serif"
  140.          Size            =   18
  141.          Charset         =   0
  142.          Weight          =   700
  143.          Underline       =   0   'False
  144.          Italic          =   0   'False
  145.          Strikethrough   =   0   'False
  146.       EndProperty
  147.       ForeColor       =   &H00FF0000&
  148.       Height          =   600
  149.       Left            =   1320
  150.       TabIndex        =   5
  151.       Top             =   120
  152.       Width           =   3645
  153.    End
  154.    Begin VB.Line Line1 
  155.       BorderColor     =   &H00FFFFFF&
  156.       BorderWidth     =   2
  157.       Index           =   0
  158.       X1              =   0
  159.       X2              =   5634.31
  160.       Y1              =   1905.001
  161.       Y2              =   1905.001
  162.    End
  163.    Begin VB.Label lblDisclaimer 
  164.       Alignment       =   2  'Center
  165.       Caption         =   "More coffee productions"
  166.       BeginProperty Font 
  167.          Name            =   "Gigi"
  168.          Size            =   14.25
  169.          Charset         =   0
  170.          Weight          =   400
  171.          Underline       =   0   'False
  172.          Italic          =   0   'False
  173.          Strikethrough   =   0   'False
  174.       EndProperty
  175.       ForeColor       =   &H00000040&
  176.       Height          =   465
  177.       Left            =   240
  178.       TabIndex        =   4
  179.       Top             =   3120
  180.       Width           =   2895
  181.    End
  182. Attribute VB_Name = "frmAbout"
  183. Attribute VB_GlobalNameSpace = False
  184. Attribute VB_Creatable = False
  185. Attribute VB_PredeclaredId = True
  186. Attribute VB_Exposed = False
  187. Option Explicit
  188. ' Reg Key Security Options...
  189. Const READ_CONTROL = &H20000
  190. Const KEY_QUERY_VALUE = &H1
  191. Const KEY_SET_VALUE = &H2
  192. Const KEY_CREATE_SUB_KEY = &H4
  193. Const KEY_ENUMERATE_SUB_KEYS = &H8
  194. Const KEY_NOTIFY = &H10
  195. Const KEY_CREATE_LINK = &H20
  196. Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
  197.                        KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
  198.                        KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL
  199.                      
  200. ' Reg Key ROOT Types...
  201. Const HKEY_LOCAL_MACHINE = &H80000002
  202. Const ERROR_SUCCESS = 0
  203. Const REG_SZ = 1                         ' Unicode nul terminated string
  204. Const REG_DWORD = 4                      ' 32-bit number
  205. Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
  206. Const gREGVALSYSINFOLOC = "MSINFO"
  207. Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
  208. Const gREGVALSYSINFO = "PATH"
  209. 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
  210. 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
  211. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  212. Private Sub cmdSysInfo_Click()
  213.   Call StartSysInfo
  214. End Sub
  215. Private Sub cmdOK_Click()
  216.   Credits.Show
  217.   Unload Me
  218. End Sub
  219. Private Sub Form_Load()
  220.     'Me.Caption = "About " & App.Title
  221.     'lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
  222.     'lblTitle.Caption = App.Title
  223.     picIcon = Picture2
  224. End Sub
  225. Public Sub StartSysInfo()
  226.     On Error GoTo SysInfoErr
  227.     Dim rc As Long
  228.     Dim SysInfoPath As String
  229.     ' Try To Get System Info Program Path\Name From Registry...
  230.     If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
  231.     ' Try To Get System Info Program Path Only From Registry...
  232.     ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
  233.         ' Validate Existance Of Known 32 Bit File Version
  234.         If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
  235.             SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
  236.             
  237.         ' Error - File Can Not Be Found...
  238.         Else
  239.             GoTo SysInfoErr
  240.         End If
  241.     ' Error - Registry Entry Can Not Be Found...
  242.     Else
  243.         GoTo SysInfoErr
  244.     End If
  245.     Call Shell(SysInfoPath, vbNormalFocus)
  246.     Exit Sub
  247. SysInfoErr:
  248.     MsgBox "System Information Is Unavailable At This Time", vbOKOnly
  249. End Sub
  250. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
  251.     Dim i As Long                                           ' Loop Counter
  252.     Dim rc As Long                                          ' Return Code
  253.     Dim hKey As Long                                        ' Handle To An Open Registry Key
  254.     Dim hDepth As Long                                      '
  255.     Dim KeyValType As Long                                  ' Data Type Of A Registry Key
  256.     Dim tmpVal As String                                    ' Tempory Storage For A Registry Key Value
  257.     Dim KeyValSize As Long                                  ' Size Of Registry Key Variable
  258.     '------------------------------------------------------------
  259.     ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
  260.     '------------------------------------------------------------
  261.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
  262.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Error...
  263.     tmpVal = String$(1024, 0)                             ' Allocate Variable Space
  264.     KeyValSize = 1024                                       ' Mark Variable Size
  265.     '------------------------------------------------------------
  266.     ' Retrieve Registry Key Value...
  267.     '------------------------------------------------------------
  268.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
  269.                          KeyValType, tmpVal, KeyValSize)    ' Get/Create Key Value
  270.                         
  271.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Errors
  272.     If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then           ' Win95 Adds Null Terminated String...
  273.         tmpVal = Left(tmpVal, KeyValSize - 1)               ' Null Found, Extract From String
  274.     Else                                                    ' WinNT Does NOT Null Terminate String...
  275.         tmpVal = Left(tmpVal, KeyValSize)                   ' Null Not Found, Extract String Only
  276.     End If
  277.     '------------------------------------------------------------
  278.     ' Determine Key Value Type For Conversion...
  279.     '------------------------------------------------------------
  280.     Select Case KeyValType                                  ' Search Data Types...
  281.     Case REG_SZ                                             ' String Registry Key Data Type
  282.         KeyVal = tmpVal                                     ' Copy String Value
  283.     Case REG_DWORD                                          ' Double Word Registry Key Data Type
  284.         For i = Len(tmpVal) To 1 Step -1                    ' Convert Each Bit
  285.             KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1)))   ' Build Value Char. By Char.
  286.         Next
  287.         KeyVal = Format$("&h" + KeyVal)                     ' Convert Double Word To String
  288.     End Select
  289.     GetKeyValue = True                                      ' Return Success
  290.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  291.     Exit Function                                           ' Exit
  292. GetKeyError:      ' Cleanup After An Error Has Occured...
  293.     KeyVal = ""                                             ' Set Return Val To Empty String
  294.     GetKeyValue = False                                     ' Return Failure
  295.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  296. End Function
  297. Private Sub Timer1_Timer()
  298. If picIcon = Picture2 Then
  299. picIcon = Picture1
  300. picIcon = Picture2
  301. End If
  302. End Sub
  303. Private Sub Timer2_Timer()
  304. Label1.Left = Label1.Left + 10
  305. If Label1.Left > Form1.Width Then Label1.Left = -3500
  306. End Sub
  307.