取得用户已经安装的CAD版本
'取得用户已经安装的CAD版本
Sub GetAllCADVersion()
Dim hKey As Long
Dim i
Dim Temp As String * 256
Temp = Space(256)
If RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Autodesk\AutoCAD", hKey) = ERROR_SUCCESS Then
While RegEnumKey(hKey, i, Temp, 256) = ERROR_SUCCESS
Select Case Left(Trim(Temp), Len(Trim(Temp)) - 1)
Case "R14.0"
Me.Check1.Value = 1: Me.Check1.Enabled = True
Case "R15.0"
Me.Check2.Value = 1: Me.Check2.Enabled = True
Case "R16.0"
Me.Check3.Value = 1: Me.Check3.Enabled = True
Case "R16.1"
Me.Check4.Value = 1: Me.Check4.Enabled = True
Case "R16.2"
Me.Check5.Value = 1: Me.Check5.Enabled = True
Case "R17.0"
Me.Check6.Value = 1: Me.Check6.Enabled = True
Case "R17.1"
Me.Check7.Value = 1: Me.Check7.Enabled = True
End Select
i = i + 1
Wend
RegCloseKey hKey
End If
End Sub
Sub GetAllCADVersion()
Dim hKey As Long
Dim i
Dim Temp As String * 256
Temp = Space(256)
If RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Autodesk\AutoCAD", hKey) = ERROR_SUCCESS Then
While RegEnumKey(hKey, i, Temp, 256) = ERROR_SUCCESS
Select Case Left(Trim(Temp), Len(Trim(Temp)) - 1)
Case "R14.0"
Me.Check1.Value = 1: Me.Check1.Enabled = True
Case "R15.0"
Me.Check2.Value = 1: Me.Check2.Enabled = True
Case "R16.0"
Me.Check3.Value = 1: Me.Check3.Enabled = True
Case "R16.1"
Me.Check4.Value = 1: Me.Check4.Enabled = True
Case "R16.2"
Me.Check5.Value = 1: Me.Check5.Enabled = True
Case "R17.0"
Me.Check6.Value = 1: Me.Check6.Enabled = True
Case "R17.1"
Me.Check7.Value = 1: Me.Check7.Enabled = True
End Select
i = i + 1
Wend
RegCloseKey hKey
End If
End Sub
[本日志由 tiancao1001 于 2009-03-05 03:12 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |