home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / SourceCode558122182002.psc / SCO / AboutF.frm (.txt) next >
Encoding:
Visual Basic Form  |  2002-02-18  |  11.2 KB  |  273 lines

  1. VERSION 5.00
  2. Begin VB.Form AboutF 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "About Source Code Organizer V.1"
  5.    ClientHeight    =   3690
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   3630
  9.    HelpContextID   =   1340
  10.    Icon            =   "AboutF.frx":0000
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3690
  16.    ScaleWidth      =   3630
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.Frame Frame3 
  19.       Caption         =   "Contact Information"
  20.       Height          =   1215
  21.       Left            =   120
  22.       TabIndex        =   4
  23.       Top             =   1080
  24.       Width           =   3375
  25.       Begin VB.Label Label4 
  26.          AutoSize        =   -1  'True
  27.          Caption         =   "extremedexter_z2001@yahoo.com"
  28.          BeginProperty Font 
  29.             Name            =   "MS Sans Serif"
  30.             Size            =   8.25
  31.             Charset         =   0
  32.             Weight          =   400
  33.             Underline       =   -1  'True
  34.             Italic          =   0   'False
  35.             Strikethrough   =   0   'False
  36.          EndProperty
  37.          ForeColor       =   &H00FF0000&
  38.          Height          =   195
  39.          Left            =   600
  40.          MousePointer    =   99  'Custom
  41.          TabIndex        =   7
  42.          ToolTipText     =   "E-mail Developer"
  43.          Top             =   720
  44.          Width           =   2460
  45.       End
  46.       Begin VB.Label Label2 
  47.          AutoSize        =   -1  'True
  48.          Caption         =   "Mail:"
  49.          Height          =   195
  50.          Index           =   0
  51.          Left            =   240
  52.          TabIndex        =   6
  53.          Top             =   720
  54.          Width           =   330
  55.       End
  56.       Begin VB.Label Label1 
  57.          AutoSize        =   -1  'True
  58.          BackStyle       =   0  'Transparent
  59.          Caption         =   "Written by: Dexter Zafra"
  60.          Height          =   195
  61.          Left            =   240
  62.          TabIndex        =   5
  63.          Top             =   360
  64.          Width           =   1695
  65.       End
  66.    End
  67.    Begin VB.Frame Frame4 
  68.       Caption         =   "Website"
  69.       Height          =   735
  70.       Left            =   120
  71.       TabIndex        =   2
  72.       Top             =   2400
  73.       Width           =   3375
  74.       Begin VB.Label Label3 
  75.          AutoSize        =   -1  'True
  76.          Caption         =   "http://clik.to/ret"
  77.          BeginProperty Font 
  78.             Name            =   "MS Sans Serif"
  79.             Size            =   9.75
  80.             Charset         =   0
  81.             Weight          =   400
  82.             Underline       =   -1  'True
  83.             Italic          =   0   'False
  84.             Strikethrough   =   0   'False
  85.          EndProperty
  86.          ForeColor       =   &H00FF0000&
  87.          Height          =   240
  88.          Left            =   960
  89.          MousePointer    =   99  'Custom
  90.          TabIndex        =   3
  91.          ToolTipText     =   "Visit Developer's Website"
  92.          Top             =   240
  93.          Width           =   1515
  94.       End
  95.    End
  96.    Begin VB.CommandButton Command1 
  97.       Caption         =   "&OK"
  98.       Height          =   375
  99.       Left            =   240
  100.       TabIndex        =   1
  101.       Top             =   3240
  102.       Width           =   1455
  103.    End
  104.    Begin VB.CommandButton Command2 
  105.       Caption         =   "&System Info ..."
  106.       Height          =   375
  107.       Left            =   1920
  108.       TabIndex        =   0
  109.       Top             =   3240
  110.       Width           =   1455
  111.    End
  112.    Begin VB.Label Label24 
  113.       Caption         =   "Organizer"
  114.       BeginProperty Font 
  115.          Name            =   "MS Sans Serif"
  116.          Size            =   12
  117.          Charset         =   0
  118.          Weight          =   700
  119.          Underline       =   0   'False
  120.          Italic          =   0   'False
  121.          Strikethrough   =   0   'False
  122.       EndProperty
  123.       Height          =   375
  124.       Left            =   600
  125.       TabIndex        =   10
  126.       Top             =   600
  127.       Width           =   1335
  128.    End
  129.    Begin VB.Label Label8 
  130.       AutoSize        =   -1  'True
  131.       Caption         =   "Source Code"
  132.       BeginProperty Font 
  133.          Name            =   "Arial"
  134.          Size            =   20.25
  135.          Charset         =   0
  136.          Weight          =   700
  137.          Underline       =   0   'False
  138.          Italic          =   0   'False
  139.          Strikethrough   =   0   'False
  140.       EndProperty
  141.       Height          =   480
  142.       Left            =   480
  143.       TabIndex        =   9
  144.       Top             =   120
  145.       Width           =   2550
  146.    End
  147.    Begin VB.Label Label9 
  148.       AutoSize        =   -1  'True
  149.       Caption         =   "Version 1"
  150.       Height          =   195
  151.       Left            =   2040
  152.       TabIndex        =   8
  153.       Top             =   720
  154.       Width           =   660
  155.    End
  156. Attribute VB_Name = "AboutF"
  157. Attribute VB_GlobalNameSpace = False
  158. Attribute VB_Creatable = False
  159. Attribute VB_PredeclaredId = True
  160. Attribute VB_Exposed = False
  161. Option Explicit
  162. ' Reg Key Security Options...
  163. Const READ_CONTROL = &H20000
  164. Const KEY_QUERY_VALUE = &H1
  165. Const KEY_SET_VALUE = &H2
  166. Const KEY_CREATE_SUB_KEY = &H4
  167. Const KEY_ENUMERATE_SUB_KEYS = &H8
  168. Const KEY_NOTIFY = &H10
  169. Const KEY_CREATE_LINK = &H20
  170. Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
  171.                        KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
  172.                        KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL
  173.                      
  174. ' Reg Key ROOT Types...
  175. Const HKEY_LOCAL_MACHINE = &H80000002
  176. Const ERROR_SUCCESS = 0
  177. Const REG_SZ = 1                         ' Unicode nul terminated string
  178. Const REG_DWORD = 4                      ' 32-bit number
  179. Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
  180. Const gREGVALSYSINFOLOC = "MSINFO"
  181. Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
  182. Const gREGVALSYSINFO = "PATH"
  183. 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
  184. 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
  185. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  186. Private Sub Command1_Click()
  187.     Unload Me
  188. End Sub
  189. Private Sub Command2_Click()
  190.     Call StartSysInfo
  191. End Sub
  192. Private Sub Form_KeyPress(KeyAscii As Integer)
  193.     If KeyAscii = 27 Then Unload Me
  194. End Sub
  195. Private Sub Label3_Click()
  196. On Error Resume Next
  197.     Dim xRet As Long
  198.     xRet = ShellExecute(0, vbNullString, "http://clik.to/ret", vbNullString, App.Path, 1)
  199. End Sub
  200. Private Sub Label4_Click()
  201. On Error Resume Next
  202.  Call email("extremedexter_z2001@yahoo.com")
  203. End Sub
  204. Public Sub StartSysInfo()
  205.     On Error GoTo SysInfoErr
  206.     Dim rc As Long
  207.     Dim SysInfoPath As String
  208.     If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
  209.    ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
  210.         If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
  211.             SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
  212.             
  213.         Else
  214.             GoTo SysInfoErr
  215.         End If
  216.         Else
  217.         GoTo SysInfoErr
  218.     End If
  219.     Call Shell(SysInfoPath, vbNormalFocus)
  220.     Exit Sub
  221. SysInfoErr:
  222.     MsgBox "La informaci
  223. n del sistema no est
  224.  disponible en este momento.", vbOKOnly
  225. End Sub
  226. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
  227.     Dim i As Long                                           ' Loop Counter
  228.     Dim rc As Long                                          ' Return Code
  229.     Dim hKey As Long                                        ' Handle To An Open Registry Key
  230.     Dim hDepth As Long                                      '
  231.     Dim KeyValType As Long                                  ' Data Type Of A Registry Key
  232.     Dim tmpVal As String                                    ' Tempory Storage For A Registry Key Value
  233.     Dim KeyValSize As Long                                  ' Size Of Registry Key Variable
  234.     '------------------------------------------------------------
  235.     ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
  236.     '------------------------------------------------------------
  237.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
  238.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Error...
  239.     tmpVal = String$(1024, 0)                             ' Allocate Variable Space
  240.     KeyValSize = 1024                                       ' Mark Variable Size
  241.     '------------------------------------------------------------
  242.     ' Retrieve Registry Key Value...
  243.     '------------------------------------------------------------
  244.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
  245.                          KeyValType, tmpVal, KeyValSize)    ' Get/Create Key Value
  246.                         
  247.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Errors
  248.     If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then           ' Win95 Adds Null Terminated String...
  249.         tmpVal = left(tmpVal, KeyValSize - 1)               ' Null Found, Extract From String
  250.     Else                                                    ' WinNT Does NOT Null Terminate String...
  251.         tmpVal = left(tmpVal, KeyValSize)                   ' Null Not Found, Extract String Only
  252.     End If
  253.     '------------------------------------------------------------
  254.     ' Determine Key Value Type For Conversion...
  255.     '------------------------------------------------------------
  256.     Select Case KeyValType                                  ' Search Data Types...
  257.     Case REG_SZ                                             ' String Registry Key Data Type
  258.         KeyVal = tmpVal                                     ' Copy String Value
  259.     Case REG_DWORD                                          ' Double Word Registry Key Data Type
  260.         For i = Len(tmpVal) To 1 Step -1                    ' Convert Each Bit
  261.             KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1)))   ' Build Value Char. By Char.
  262.         Next
  263.         KeyVal = Format$("&h" + KeyVal)                     ' Convert Double Word To String
  264.     End Select
  265.     GetKeyValue = True                                      ' Return Success
  266.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  267.     Exit Function                                           ' Exit
  268. GetKeyError:      ' Cleanup After An Error Has Occured...
  269.     KeyVal = ""                                             ' Set Return Val To Empty String
  270.     GetKeyValue = False                                     ' Return Failure
  271.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  272. End Function
  273.