|

楼主 |
发表于 2008-3-26 16:00:54
|
显示全部楼层
已经解决
Option Explicit
'需要首先在引用对话框中加载Windows Script Host Object Modle
Dim iw1 As New WshShell '访问注册表等操作
'调用外部程序。而且还要暂停VB程序的执行,等待外部程序执行完毕后,在继续执行VB程序
'执行Windows下的记事本程序并使当前程序等待直到记事本程序关闭再执行下面的语句,
'如果不需要等待,将Run语句中的第三个参数从True改为False就可以了。
Private Sub Label1_Click()
On Error Resume Next
If getQQpath = "" Then
MsgBox "你没有安装QQ,请先安装QQ", vbOKOnly Or vbInformation, Me.Caption
Exit Sub
Else
iw1.run "tencent://Message/?Uin=543375508"
End If
End Sub
'判断是否安装QQ
Public Function getQQpath() As String
getQQpath = iw1.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ\Install")
End Function |
|