自动装入注册设置
假设有应用 myapp.exe 及一个注册文件 myapp.reg,下面的代码将自动装入注册设置。
Dim strFile As String
strFile = App.Path & "myapp.reg"
If Len(Dir$(strFile)) > 1 Then
lngRet = Shell("Regedit.exe /s " & strFile, vbNormalFocus)
End If
确定当前 WIN95 的启动状态
定义:
Public Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Public Const SM_CLEANBOOT = 67
使用:
Select Case GetSystemMetrics(SM_CLEANBOOT)
Case 1: MsgBox "在安全模式。"
Case 2: MsgBox "在带网络环境的安全模式。"
Case Else: MsgBox "正常模式。"
End Select
|