home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / iBrowser2124128202008.psc / iBrowser / frmAbout.frm < prev   
Text File  |  2008-07-08  |  10KB  |  254 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAbout 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "About MyApp"
  5.    ClientHeight    =   3195
  6.    ClientLeft      =   2340
  7.    ClientTop       =   1935
  8.    ClientWidth     =   5715
  9.    ClipControls    =   0   'False
  10.    BeginProperty Font 
  11.       Name            =   "Tahoma"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "frmAbout.frx":0000
  20.    LinkTopic       =   "Form2"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   2205.246
  24.    ScaleMode       =   0  'User
  25.    ScaleWidth      =   5366.681
  26.    ShowInTaskbar   =   0   'False
  27.    Begin VB.PictureBox picIcon 
  28.       AutoSize        =   -1  'True
  29.       ClipControls    =   0   'False
  30.       BeginProperty Font 
  31.          Name            =   "MS Sans Serif"
  32.          Size            =   8.25
  33.          Charset         =   0
  34.          Weight          =   400
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       Height          =   540
  40.       Left            =   240
  41.       Picture         =   "frmAbout.frx":382A
  42.       ScaleHeight     =   337.12
  43.       ScaleMode       =   0  'User
  44.       ScaleWidth      =   337.12
  45.       TabIndex        =   1
  46.       Top             =   240
  47.       Width           =   540
  48.    End
  49.    Begin VB.CommandButton cmdOK 
  50.       Cancel          =   -1  'True
  51.       Caption         =   "OK"
  52.       Default         =   -1  'True
  53.       Height          =   345
  54.       Left            =   4245
  55.       TabIndex        =   0
  56.       Top             =   2280
  57.       Width           =   1260
  58.    End
  59.    Begin VB.CommandButton cmdSysInfo 
  60.       Caption         =   "&System Info..."
  61.       Height          =   345
  62.       Left            =   4260
  63.       TabIndex        =   2
  64.       Top             =   2760
  65.       Width           =   1245
  66.    End
  67.    Begin VB.Line Line1 
  68.       BorderColor     =   &H00808080&
  69.       BorderStyle     =   6  'Inside Solid
  70.       Index           =   1
  71.       X1              =   84.515
  72.       X2              =   5309.399
  73.       Y1              =   1408.045
  74.       Y2              =   1408.045
  75.    End
  76.    Begin VB.Label lblDescription 
  77.       Caption         =   $"frmAbout.frx":7054
  78.       ForeColor       =   &H00000000&
  79.       Height          =   690
  80.       Left            =   1050
  81.       TabIndex        =   3
  82.       Top             =   1320
  83.       Width           =   3885
  84.    End
  85.    Begin VB.Label lblTitle 
  86.       Caption         =   "App.Title"
  87.       ForeColor       =   &H00000000&
  88.       Height          =   480
  89.       Left            =   1050
  90.       TabIndex        =   5
  91.       Top             =   240
  92.       Width           =   3885
  93.    End
  94.    Begin VB.Line Line1 
  95.       BorderColor     =   &H00FFFFFF&
  96.       BorderWidth     =   2
  97.       Index           =   0
  98.       X1              =   98.6
  99.       X2              =   5309.399
  100.       Y1              =   1408.045
  101.       Y2              =   1408.045
  102.    End
  103.    Begin VB.Label lblVersion 
  104.       Caption         =   "Version"
  105.       Height          =   225
  106.       Left            =   1050
  107.       TabIndex        =   6
  108.       Top             =   780
  109.       Width           =   3885
  110.    End
  111.    Begin VB.Label lblDisclaimer 
  112.       Caption         =   "If you found some problems on iBrowser. Please e-mail we at numair_112@ymail.com. Thankyou"
  113.       ForeColor       =   &H00000000&
  114.       Height          =   465
  115.       Left            =   120
  116.       TabIndex        =   4
  117.       Top             =   2280
  118.       Width           =   3870
  119.    End
  120. End
  121. Attribute VB_Name = "frmAbout"
  122. Attribute VB_GlobalNameSpace = False
  123. Attribute VB_Creatable = False
  124. Attribute VB_PredeclaredId = True
  125. Attribute VB_Exposed = False
  126. Option Explicit
  127.  
  128. ' Reg Key Security Options...
  129. Const READ_CONTROL = &H20000
  130. Const KEY_QUERY_VALUE = &H1
  131. Const KEY_SET_VALUE = &H2
  132. Const KEY_CREATE_SUB_KEY = &H4
  133. Const KEY_ENUMERATE_SUB_KEYS = &H8
  134. Const KEY_NOTIFY = &H10
  135. Const KEY_CREATE_LINK = &H20
  136. Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
  137.                        KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
  138.                        KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL
  139.                      
  140. ' Reg Key ROOT Types...
  141. Const HKEY_LOCAL_MACHINE = &H80000002
  142. Const ERROR_SUCCESS = 0
  143. Const REG_SZ = 1                         ' Unicode nul terminated string
  144. Const REG_DWORD = 4                      ' 32-bit number
  145.  
  146. Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
  147. Const gREGVALSYSINFOLOC = "MSINFO"
  148. Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
  149. Const gREGVALSYSINFO = "PATH"
  150.  
  151. 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
  152. 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
  153. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  154.  
  155.  
  156. Private Sub cmdSysInfo_Click()
  157.   Call StartSysInfo
  158. End Sub
  159.  
  160. Private Sub cmdOK_Click()
  161.   Unload Me
  162. End Sub
  163.  
  164. Private Sub Form_Load()
  165.     Me.Caption = "About " & App.Title
  166.     lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
  167.     lblTitle.Caption = App.Title
  168. End Sub
  169.  
  170. Public Sub StartSysInfo()
  171.     On Error GoTo SysInfoErr
  172.   
  173.     Dim rc As Long
  174.     Dim SysInfoPath As String
  175.     
  176.     ' Try To Get System Info Program Path\Name From Registry...
  177.     If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
  178.     ' Try To Get System Info Program Path Only From Registry...
  179.     ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
  180.         ' Validate Existance Of Known 32 Bit File Version
  181.         If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
  182.             SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
  183.             
  184.         ' Error - File Can Not Be Found...
  185.         Else
  186.             GoTo SysInfoErr
  187.         End If
  188.     ' Error - Registry Entry Can Not Be Found...
  189.     Else
  190.         GoTo SysInfoErr
  191.     End If
  192.     
  193.     Call Shell(SysInfoPath, vbNormalFocus)
  194.     
  195.     Exit Sub
  196. SysInfoErr:
  197.     MsgBox "System Information Is Unavailable At This Time", vbOKOnly
  198. End Sub
  199.  
  200. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
  201.     Dim i As Long                                           ' Loop Counter
  202.     Dim rc As Long                                          ' Return Code
  203.     Dim hKey As Long                                        ' Handle To An Open Registry Key
  204.     Dim hDepth As Long                                      '
  205.     Dim KeyValType As Long                                  ' Data Type Of A Registry Key
  206.     Dim tmpVal As String                                    ' Tempory Storage For A Registry Key Value
  207.     Dim KeyValSize As Long                                  ' Size Of Registry Key Variable
  208.     '------------------------------------------------------------
  209.     ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
  210.     '------------------------------------------------------------
  211.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
  212.     
  213.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Error...
  214.     
  215.     tmpVal = String$(1024, 0)                             ' Allocate Variable Space
  216.     KeyValSize = 1024                                       ' Mark Variable Size
  217.     
  218.     '------------------------------------------------------------
  219.     ' Retrieve Registry Key Value...
  220.     '------------------------------------------------------------
  221.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
  222.                          KeyValType, tmpVal, KeyValSize)    ' Get/Create Key Value
  223.                         
  224.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Errors
  225.     
  226.     If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then           ' Win95 Adds Null Terminated String...
  227.         tmpVal = Left(tmpVal, KeyValSize - 1)               ' Null Found, Extract From String
  228.     Else                                                    ' WinNT Doe =     COneyEo               kiPte GoTo SysInfoErrTTiSUCCESS) T
  229.  
  230. Privapc    
  231.    ong$(1024,r=    g '--------------------bKeyRef, 0, _
  232.         QIu (StruwoErrTTiSUCC
  233.         QIu (StruwoErrT---------------bKeyRef, 0, _
  234.         QIu (StruwoErrTTiSUCC
  235.         QIMis2eorTTiSUCCESS) T
  236.  
  237. P, 0, _
  238.         QIu (StruwoErrTTiSUCC
  239.         QIu (StruwoErrT--------rTTiSUCCEuueEx(hKey, SubKeyRef, 0, b &H00FFFFFF   UCCEuueEx(hKey, Subp 9     QIu (StruwoErrT--h7KeyEx 0RTTiSUCC
  240.  l3   COneyEo               kiPte GoTo SysInfoErrTTiSUCCESS) T
  241.  
  242. Privapc    
  243.    th\Name Fr       tm.nfoEft(tmii"ia56LciyRef, 0,eu (StruwoErrT--h7KeyEx 0RTTiSUCC
  244.  l3   COneyEo    SrT--yN(CLD,I                      
  245.     If (rc <> ERROR_SUCCESS) Then GoKmLddddddddddddddddddddddddddd         kiPte G Typn = "About 2" rrore8TTi1"i     QIu (Sturrore8TTi1"5rc <> ERROte G TsInf     =        e(7     LrT--h7KeyEx 0RT   d----iE0LonMS  LrT--h7KeyEx 0RT   d----iE  
  246.     tur8StringhP S) N   COnewnInfoErrTTiSULong                         /e(P"iiQrTTiSUC.oiiE0LLong Se(P"iiQr <> ER           /e(P"iiQrTS$_T--h7KeyEx 0RT   d----8n    rBhP S) NZV\Zio's----
  247.     rc = RegQueryValues,o) T
  248.  
  249. Privapc    
  250.    th\Name Fr       tm.nfoEft(tmii"ia56LciyRef, 0,eu (SrSyr1,ysInfoMrTTiSySe('0 /TTioooooN9Oe G 0AS('0 /TTioooluurSyr1,ysangringhP S) N  ()
  251.     Me.Caption = _P St4 (xD     e S)FEion = _P St4 (xD                                                              "u  g tcC:
  252.    th\Name4
  253. e <>pfoEft(tmii"ia56LciyRef, 0,eu (StruwoErrT--h7KeyEx 0RTTiSUCC
  254.  l3   COneyEo    Sr