home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form frmAbout BorderStyle = 4 'Fixed ToolWindow Caption = "About MyApp" ClientHeight = 3555 ClientLeft = 2340 ClientTop = 1890 ClientWidth = 5730 ClipControls = 0 'False LinkTopic = "Form2" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 2453.724 ScaleMode = 0 'User ScaleWidth = 5380.766 ShowInTaskbar = 0 'False StartUpPosition = 2 'CenterScreen Begin VB.PictureBox picIcon AutoSize = -1 'True BorderStyle = 0 'None ClipControls = 0 'False Height = 480 Left = 240 Picture = "frmAbout.frx":0000 ScaleHeight = 337.12 ScaleMode = 0 'User ScaleWidth = 337.12 TabIndex = 1 Top = 240 Width = 480 End Begin VB.CommandButton cmdOK Cancel = -1 'True Caption = "OK" Default = -1 'True Height = 345 Left = 4245 TabIndex = 0 Top = 2625 Width = 1260 End Begin VB.CommandButton cmdSysInfo Caption = "&System Info..." Height = 345 Left = 4260 TabIndex = 2 Top = 3075 Width = 1245 End Begin VB.Label Label2 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Web page: " BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = -1 'True Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 1080 TabIndex = 8 Top = 1560 Width = 840 End Begin VB.Label Label1 Caption = "http://www.geocities.com/ResearchTriangle/Campus/4598/ pd.html" ForeColor = &H00FF0000& Height = 495 Left = 1050 MouseIcon = "frmAbout.frx":030A MousePointer = 99 'Custom TabIndex = 7 Top = 1800 Width = 4455 WordWrap = -1 'True End Begin VB.Line Line1 BorderColor = &H00808080& BorderStyle = 6 'Inside Solid Index = 1 X1 = 84.515 X2 = 5309.398 Y1 = 1687.583 Y2 = 1687.583 End Begin VB.Label lblDescription Caption = "Copyright 1999 for Mostafa, All Right Reserved" ForeColor = &H00000000& Height = 330 Left = 1050 TabIndex = 3 Top = 1125 Width = 3885 End Begin VB.Label lblTitle Caption = "Application Title" ForeColor = &H00000000& Height = 480 Left = 1050 TabIndex = 5 Top = 240 Width = 3885 End Begin VB.Line Line1 BorderColor = &H00FFFFFF& BorderWidth = 2 Index = 0 X1 = 98.6 X2 = 5309.398 Y1 = 1697.936 Y2 = 1697.936 End Begin VB.Label lblVersion Caption = "Version" Height = 225 Left = 1050 TabIndex = 6 Top = 780 Width = 3885 End Begin VB.Label lblDisclaimer Caption = "Warning: ...This program is protected by copyright laws." ForeColor = &H00000000& Height = 825 Left = 255 TabIndex = 4 Top = 2625 Width = 3870 End Attribute VB_Name = "frmAbout" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Const READ_CONTROL = &H20000 Const KEY_QUERY_VALUE = &H1 Const KEY_SET_VALUE = &H2 Const KEY_CREATE_SUB_KEY = &H4 Const KEY_ENUMERATE_SUB_KEYS = &H8 Const KEY_NOTIFY = &H10 Const KEY_CREATE_LINK = &H20 Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _ KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _ KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL Const HKEY_LOCAL_MACHINE = &H80000002 Const ERROR_SUCCESS = 0 Const REG_SZ = 1 Const REG_DWORD = 4 Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location" Const gREGVALSYSINFOLOC = "MSINFO" Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO" Const gREGVALSYSINFO = "PATH" 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 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 Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long Private Sub cmdSysInfo_Click() Call StartSysInfo End Sub Private Sub cmdOK_Click() Unload Me End Sub Private Sub Form_Load() On Error Resume Next Me.Caption = "About " & App.Title lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision lblTitle.Caption = App.Title + " (Trial Version)" End Sub Public Sub StartSysInfo() On Error GoTo SysInfoErr Dim rc As Long Dim SysInfoPath As String If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then SysInfoPath = SysInfoPath & "\MSINFO32.EXE" Else GoTo SysInfoErr End If Else GoTo SysInfoErr End If Call Shell(SysInfoPath, vbNormalFocus) Exit Sub SysInfoErr: MsgBox "System Information Is Unavailable At This Time", vbOKOnly End Sub Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean Dim i As Long Dim rc As Long Dim hKey As Long Dim hDepth As Long Dim KeyValType As Long Dim tmpVal As String Dim KeyValSize As Long rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError tmpVal = String$(1024, 0) KeyValSize = 1024 rc = RegQueryValueEx(hKey, SubKeyRef, 0, _ KeyValType, tmpVal, KeyValSize) If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then ' Win95 Adds Null Terminated String... If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then tmpVal = Left(tmpVal, KeyValSize - 1) ' Null Found, Extract From String Else ' WinNT Does NOT Null Terminate String... tmpVal = Left(tmpVal, KeyValSize) ' Null Not Found, Extract String Only End If Select Case KeyValType ' Search Data Types... Case REG_SZ ' String Registry Key Data Type KeyVal = tmpVal ' Copy String Value Case REG_DWORD ' Double Word Registry Key Data Type For i = Len(tmpVal) To 1 Step -1 ' Convert Each Bit KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1))) ' Build Value Char. By Char. Next KeyVal = Format$("&h" + KeyVal) ' Convert Double Word To String End Select End If GetKeyValue = True ' Return Success rc = RegCloseKey(hKey) ' Close Registry Key Exit Function ' Exit GetKeyError: ' Cleanup After An Error Has Occured... KeyVal = "" ' Set Return Val To Empty String GetKeyValue = False ' Return Failure rc = RegCloseKey(hKey) ' Close Registry Key End Function Private Sub Label1_Click() On Error Resume Next Dim Scr_hDC As Long Dim startdoc As Long Dim l, txtt Scr_hDC = GetDesktopWindow() startdoc = ShellExecute(Scr_hDC, "Open", "http://www.geocities.com/ResearchTriangle/Campus/4598/ pd.html", "", "c:\", SW_SHOWNORMAL) If Err Then MsgBox Err.Description End If End Sub