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