</pre><pre name="code" class="vb">'作用:判断某控件是否注册
'参数:lpCOM,控件名字
'返回:true或false,真代表已注册
Private Function IsCOMRegistered(lpCOM As String) As Boolean
Dim PID As Variant
Dim RegText As String
Dim oText
'
IsCOMRegistered = False
PID = Shell("cmd.exe /c Reg Query HKCR\CLSID /f " & LCase(lpCOM) & " /t REG_SZ /s|Clip", vbHide)
Do While PID = 0
DoEvents
Loop
RegText = LCase(Clipboard.GetText)
'MsgBox RegText
For Each oText In Split(RegText, vbCrLf)
If InStr(oText, LCase(lpCOM)) Then
IsCOMRegistered = True
Exit For
End If
Next
End Function
vb6.0 判断控件是否注册
最新推荐文章于 2017-01-17 21:33:26 发布