?? frmabout.frm
字號:
VERSION 5.00
Begin VB.Form frmAbout
BorderStyle = 1 'Fixed Single
Caption = "關(guān)于 學(xué)籍管理系統(tǒng)"
ClientHeight = 2985
ClientLeft = 45
ClientTop = 330
ClientWidth = 5625
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2985
ScaleWidth = 5625
Begin VB.Frame Frame1
Caption = "關(guān)于 學(xué)生成績管理系統(tǒng)"
Height = 1335
Left = 960
TabIndex = 4
Top = 120
Width = 4455
Begin VB.Label Label1
Caption = $"frmAbout.frx":0000
Height = 855
Left = 240
TabIndex = 5
Top = 360
Width = 4095
End
End
Begin VB.CommandButton Command1
Caption = "確定(&Y)"
Height = 375
Left = 4200
TabIndex = 3
Top = 1920
Width = 1215
End
Begin VB.Frame Frame2
Height = 975
Left = 240
TabIndex = 2
Top = 1800
Width = 3735
End
Begin VB.PictureBox picIcon
AutoSize = -1 'True
BackColor = &H00C0C0C0&
ClipControls = 0 'False
Height = 540
Left = 240
Picture = "frmAbout.frx":00A4
ScaleHeight = 480
ScaleMode = 0 'User
ScaleWidth = 480
TabIndex = 1
TabStop = 0 'False
Top = 240
Width = 540
End
Begin VB.CommandButton Command2
Caption = "系統(tǒng)信息(&S)"
Height = 375
Left = 4200
TabIndex = 0
Top = 2400
Width = 1215
End
Begin VB.Line Line1
BorderColor = &H00808080&
BorderStyle = 6 'Inside Solid
Index = 1
X1 = 240
X2 = 5400
Y1 = 1680
Y2 = 1680
End
End
Attribute VB_Name = "frmAbout"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' 注冊鍵安全選項...
Const KEY_ALL_ACCESS = &H2003F
' 注冊鍵根類型...
Const HKEY_LOCAL_MACHINE = &H80000002
Const ERROR_SUCCESS = 0
Const REG_SZ = 1 ' Unicode 空結(jié)尾字符串
Const REG_DWORD = 4 ' 32位數(shù)
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
Public Sub StartSysInfo()
On Error GoTo SysInfoErr
Dim rc As Long
Dim SysInfoPath As String
' 從注冊表獲得系統(tǒng)信息程序路徑\名稱...
If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
' 僅從注冊表獲得系統(tǒng)信息程序路徑...
ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
' 驗證已知的 32 位文件版本的存在
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 "此時系統(tǒng)信息不可用", 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 ' 循環(huán)記數(shù)器
Dim rc As Long ' 返回代碼
Dim hKey As Long ' 打開的注冊表鍵句柄
Dim hDepth As Long '
Dim KeyValType As Long ' 注冊表鍵數(shù)據(jù)類型
Dim tmpVal As String ' 臨時存儲一個注冊表鍵值
Dim KeyValSize As Long ' 注冊表鍵變量大小
'------------------------------------------------------------
' 在鍵根{HKEY_LOCAL_MACHINE...}之下打開注冊鍵
'------------------------------------------------------------
rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' 打開注冊表鍵
If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' 錯誤處理...
tmpVal = String$(1024, 0) ' 分配變量空間
KeyValSize = 1024 ' 標(biāo)記變量大小
'------------------------------------------------------------
' 檢索注冊表鍵值...
'------------------------------------------------------------
rc = RegQueryValueEx(hKey, SubKeyRef, 0, KeyValType, tmpVal, KeyValSize) ' 獲得/創(chuàng)建鍵值
If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' 錯誤處理
tmpVal = VBA.Left(tmpVal, InStr(tmpVal, VBA.Chr(0)) - 1)
'------------------------------------------------------------
' 決定轉(zhuǎn)換的鍵值類型...
'------------------------------------------------------------
Select Case KeyValType ' 搜索數(shù)據(jù)類型...
Case REG_SZ ' 字符串注冊表鍵數(shù)據(jù)類型
KeyVal = tmpVal ' 復(fù)制字符串值
Case REG_DWORD ' 雙精度注冊表鍵數(shù)據(jù)類型
For i = Len(tmpVal) To 1 Step -1 ' 轉(zhuǎn)換每一頁
KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1))) ' 一個字符一個字符地生成值
Next
KeyVal = Format$("&h" + KeyVal) ' 轉(zhuǎn)換雙精度為字符串
End Select
GetKeyValue = True ' 返回成功
rc = RegCloseKey(hKey) ' 關(guān)閉注冊表鍵
Exit Function ' 退出
GetKeyError: ' Cleanup After An Error Has Occured...
KeyVal = "" ' 設(shè)返回值為空字符串
GetKeyValue = False ' 返回失敗
rc = RegCloseKey(hKey) ' 關(guān)閉注冊表鍵
End Function
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Call StartSysInfo
End Sub
Private Sub Form_Load()
Me.Move (frmMain.ScaleWidth - Me.Width) / 2, (frmMain.ScaleHeight - Me.Height) / 2
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -