home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / Free / Prg / csplitdc.exe / fAbout.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-07-29  |  12.1 KB  |  296 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAbout 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "vbAccelerator Type Library Utility"
  5.    ClientHeight    =   4485
  6.    ClientLeft      =   6645
  7.    ClientTop       =   3555
  8.    ClientWidth     =   5055
  9.    ClipControls    =   0   'False
  10.    LinkTopic       =   "Form2"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3095.627
  14.    ScaleMode       =   0  'User
  15.    ScaleWidth      =   4746.906
  16.    ShowInTaskbar   =   0   'False
  17.    Begin VB.CommandButton cmdActiveChannel 
  18.       Height          =   420
  19.       Left            =   2400
  20.       Picture         =   "fAbout.frx":0000
  21.       Style           =   1  'Graphical
  22.       TabIndex        =   9
  23.       ToolTipText     =   "Add vbAccelerator's Active Channel"
  24.       Top             =   2400
  25.       Width           =   1815
  26.    End
  27.    Begin VB.CommandButton cmdVBAccel 
  28.       Height          =   420
  29.       Left            =   960
  30.       Picture         =   "fAbout.frx":069E
  31.       Style           =   1  'Graphical
  32.       TabIndex        =   8
  33.       ToolTipText     =   "Visit vbAccelerator on the Web"
  34.       Top             =   2400
  35.       Width           =   1395
  36.    End
  37.    Begin VB.Frame fraSep 
  38.       Height          =   75
  39.       Left            =   0
  40.       TabIndex        =   7
  41.       Top             =   3420
  42.       Width           =   5835
  43.    End
  44.    Begin VB.PictureBox picIcon 
  45.       AutoSize        =   -1  'True
  46.       BackColor       =   &H00000000&
  47.       ClipControls    =   0   'False
  48.       Height          =   720
  49.       Left            =   60
  50.       ScaleHeight     =   463.54
  51.       ScaleMode       =   0  'User
  52.       ScaleWidth      =   3381.735
  53.       TabIndex        =   1
  54.       Top             =   60
  55.       Width           =   4875
  56.       Begin VB.Image Image1 
  57.          Height          =   660
  58.          Left            =   0
  59.          Picture         =   "fAbout.frx":0BF7
  60.          Top             =   0
  61.          Width           =   2535
  62.       End
  63.    End
  64.    Begin VB.CommandButton cmdOK 
  65.       Cancel          =   -1  'True
  66.       Caption         =   "OK"
  67.       Default         =   -1  'True
  68.       BeginProperty Font 
  69.          Name            =   "Tahoma"
  70.          Size            =   8.25
  71.          Charset         =   0
  72.          Weight          =   400
  73.          Underline       =   0   'False
  74.          Italic          =   0   'False
  75.          Strikethrough   =   0   'False
  76.       EndProperty
  77.       Height          =   405
  78.       Left            =   3600
  79.       TabIndex        =   0
  80.       Top             =   3540
  81.       Width           =   1380
  82.    End
  83.    Begin VB.CommandButton cmdSysInfo 
  84.       Caption         =   "&System Info..."
  85.       BeginProperty Font 
  86.          Name            =   "Tahoma"
  87.          Size            =   8.25
  88.          Charset         =   0
  89.          Weight          =   400
  90.          Underline       =   0   'False
  91.          Italic          =   0   'False
  92.          Strikethrough   =   0   'False
  93.       EndProperty
  94.       Height          =   405
  95.       Left            =   3600
  96.       TabIndex        =   2
  97.       Top             =   4020
  98.       Width           =   1365
  99.    End
  100.    Begin VB.Label lblVersion 
  101.       BackStyle       =   0  'Transparent
  102.       Caption         =   "Version"
  103.       BeginProperty Font 
  104.          Name            =   "Tahoma"
  105.          Size            =   14.25
  106.          Charset         =   0
  107.          Weight          =   400
  108.          Underline       =   0   'False
  109.          Italic          =   0   'False
  110.          Strikethrough   =   0   'False
  111.       EndProperty
  112.       ForeColor       =   &H80000014&
  113.       Height          =   345
  114.       Left            =   2760
  115.       TabIndex        =   6
  116.       Top             =   1620
  117.       Width           =   2145
  118.    End
  119.    Begin VB.Label lblTitle 
  120.       BackStyle       =   0  'Transparent
  121.       Caption         =   "Application Title"
  122.       BeginProperty Font 
  123.          Name            =   "Tahoma"
  124.          Size            =   20.25
  125.          Charset         =   0
  126.          Weight          =   700
  127.          Underline       =   0   'False
  128.          Italic          =   0   'False
  129.          Strikethrough   =   0   'False
  130.       EndProperty
  131.       ForeColor       =   &H00000000&
  132.       Height          =   1080
  133.       Left            =   960
  134.       TabIndex        =   5
  135.       Top             =   720
  136.       Width           =   3885
  137.    End
  138.    Begin VB.Label lblDescription 
  139.       BackStyle       =   0  'Transparent
  140.       Caption         =   "Welcome to the vbAccelerator Generic Splitter Demo"
  141.       BeginProperty Font 
  142.          Name            =   "Tahoma"
  143.          Size            =   8.25
  144.          Charset         =   0
  145.          Weight          =   400
  146.          Underline       =   0   'False
  147.          Italic          =   0   'False
  148.          Strikethrough   =   0   'False
  149.       EndProperty
  150.       ForeColor       =   &H00000000&
  151.       Height          =   450
  152.       Index           =   0
  153.       Left            =   1020
  154.       TabIndex        =   3
  155.       Top             =   2040
  156.       Width           =   3885
  157.    End
  158.    Begin VB.Label lblDisclaimer 
  159.       Caption         =   $"fAbout.frx":1480
  160.       BeginProperty Font 
  161.          Name            =   "Tahoma"
  162.          Size            =   8.25
  163.          Charset         =   0
  164.          Weight          =   400
  165.          Underline       =   0   'False
  166.          Italic          =   0   'False
  167.          Strikethrough   =   0   'False
  168.       EndProperty
  169.       ForeColor       =   &H00000000&
  170.       Height          =   825
  171.       Left            =   120
  172.       TabIndex        =   4
  173.       Top             =   3585
  174.       Width           =   3270
  175.    End
  176. Attribute VB_Name = "frmAbout"
  177. Attribute VB_GlobalNameSpace = False
  178. Attribute VB_Creatable = False
  179. Attribute VB_PredeclaredId = True
  180. Attribute VB_Exposed = False
  181. Option Explicit
  182. ' Reg Key Security Options...
  183. Const READ_CONTROL = &H20000
  184. Const KEY_QUERY_VALUE = &H1
  185. Const KEY_SET_VALUE = &H2
  186. Const KEY_CREATE_SUB_KEY = &H4
  187. Const KEY_ENUMERATE_SUB_KEYS = &H8
  188. Const KEY_NOTIFY = &H10
  189. Const KEY_CREATE_LINK = &H20
  190. Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
  191.                        KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
  192.                        KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL
  193.                      
  194. ' Reg Key ROOT Types...
  195. Const HKEY_LOCAL_MACHINE = &H80000002
  196. Const ERROR_SUCCESS = 0
  197. Const REG_SZ = 1                         ' Unicode nul terminated string
  198. Const REG_DWORD = 4                      ' 32-bit number
  199. Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
  200. Const gREGVALSYSINFOLOC = "MSINFO"
  201. Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
  202. Const gREGVALSYSINFO = "PATH"
  203. 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
  204. 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
  205. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  206. Private Sub cmdActiveChannel_Click()
  207.     mfrmMain.ShellEx "http://www.dogma.demon.co.uk/vbaccel.cdf"
  208. End Sub
  209. Private Sub cmdSysInfo_Click()
  210.   StartSysInfo
  211. End Sub
  212. Private Sub cmdOK_Click()
  213.   Unload Me
  214. End Sub
  215. Private Sub cmdVBAccel_Click()
  216.     mfrmMain.ShellEx "http://www.dogma.demon.co.uk"
  217. End Sub
  218. Private Sub Form_Load()
  219.     Me.Caption = "About " & App.Title
  220.     Me.Icon = mfrmMain.Icon
  221.     lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
  222.     lblTitle.Caption = App.Title
  223. End Sub
  224. Public Sub StartSysInfo()
  225.     On Error GoTo SysInfoErr
  226.     Dim rc As Long
  227.     Dim SysInfoPath As String
  228.     ' Try To Get System Info Program Path\Name From Registry...
  229.     If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
  230.     ' Try To Get System Info Program Path Only From Registry...
  231.     ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
  232.         ' Validate Existance Of Known 32 Bit File Version
  233.         If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
  234.             SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
  235.             
  236.         ' Error - File Can Not Be Found...
  237.         Else
  238.             GoTo SysInfoErr
  239.         End If
  240.     ' Error - Registry Entry Can Not Be Found...
  241.     Else
  242.         GoTo SysInfoErr
  243.     End If
  244.     Call Shell(SysInfoPath, vbNormalFocus)
  245.     Exit Sub
  246. SysInfoErr:
  247.     MsgBox "System Information Is Unavailable At This Time", vbOKOnly
  248. End Sub
  249. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
  250.     Dim i As Long                                           ' Loop Counter
  251.     Dim rc As Long                                          ' Return Code
  252.     Dim hKey As Long                                        ' Handle To An Open Registry Key
  253.     Dim hDepth As Long                                      '
  254.     Dim KeyValType As Long                                  ' Data Type Of A Registry Key
  255.     Dim tmpVal As String                                    ' Tempory Storage For A Registry Key Value
  256.     Dim KeyValSize As Long                                  ' Size Of Registry Key Variable
  257.     '------------------------------------------------------------
  258.     ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
  259.     '------------------------------------------------------------
  260.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
  261.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Error...
  262.     tmpVal = String$(1024, 0)                             ' Allocate Variable Space
  263.     KeyValSize = 1024                                       ' Mark Variable Size
  264.     '------------------------------------------------------------
  265.     ' Retrieve Registry Key Value...
  266.     '------------------------------------------------------------
  267.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
  268.                          KeyValType, tmpVal, KeyValSize)    ' Get/Create Key Value
  269.                         
  270.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Errors
  271.     If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then           ' Win95 Adds Null Terminated String...
  272.         tmpVal = Left(tmpVal, KeyValSize - 1)               ' Null Found, Extract From String
  273.     Else                                                    ' WinNT Does NOT Null Terminate String...
  274.         tmpVal = Left(tmpVal, KeyValSize)                   ' Null Not Found, Extract String Only
  275.     End If
  276.     '------------------------------------------------------------
  277.     ' Determine Key Value Type For Conversion...
  278.     '------------------------------------------------------------
  279.     Select Case KeyValType                                  ' Search Data Types...
  280.     Case REG_SZ                                             ' String Registry Key Data Type
  281.         KeyVal = tmpVal                                     ' Copy String Value
  282.     Case REG_DWORD                                          ' Double Word Registry Key Data Type
  283.         For i = Len(tmpVal) To 1 Step -1                    ' Convert Each Bit
  284.             KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1)))   ' Build Value Char. By Char.
  285.         Next
  286.         KeyVal = Format$("&h" + KeyVal)                     ' Convert Double Word To String
  287.     End Select
  288.     GetKeyValue = True                                      ' Return Success
  289.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  290.     Exit Function                                           ' Exit
  291. GetKeyError:      ' Cleanup After An Error Has Occured...
  292.     KeyVal = ""                                             ' Set Return Val To Empty String
  293.     GetKeyValue = False                                     ' Return Failure
  294.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  295. End Function
  296.