VB获取QQ2011安装路径
2011年05月23日
VB获取QQ2011安装路径说白了就是获取注册表。。。
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
On Error Resume Next
Shell (Text1.Text & "\QQ.exe")'运行QQ程序
End Sub
Private Sub Command2_Click()
Dim 路径 As String
路径 = Text1.Text
ShellExecute Me.hwnd, vbNullString, 路径, vbNullString, vbNullString, 1 'API函数打开文件夹
' Shell "cmd.exe /c start " & Text1.Text, vbMaximizedFocus 'cmd打开文件夹
End Sub
Private Sub Command3_Click()
On Error Resume Next
Text1.Text = CreateObject("Wscript.Shell").regread("HKEY_LOCAL_MACHINE\SOFTWARE\TENCENT\QQ2009\Install") + "\bin\"
End Sub
Private Sub Form_Load()
On Error Resume Next
Text1.Text = CreateObject("Wscript.Shell").regread("HKEY_LOCAL_MACHINE\SOFTWARE\TENCENT\QQ2009\Install") + "\bin\"
End Sub
2011年05月23日
VB获取QQ2011安装路径说白了就是获取注册表。。。
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
On Error Resume Next
Shell (Text1.Text & "\QQ.exe")'运行QQ程序
End Sub
Private Sub Command2_Click()
Dim 路径 As String
路径 = Text1.Text
ShellExecute Me.hwnd, vbNullString, 路径, vbNullString, vbNullString, 1 'API函数打开文件夹
' Shell "cmd.exe /c start " & Text1.Text, vbMaximizedFocus 'cmd打开文件夹
End Sub
Private Sub Command3_Click()
On Error Resume Next
Text1.Text = CreateObject("Wscript.Shell").regread("HKEY_LOCAL_MACHINE\SOFTWARE\TENCENT\QQ2009\Install") + "\bin\"
End Sub
Private Sub Form_Load()
On Error Resume Next
Text1.Text = CreateObject("Wscript.Shell").regread("HKEY_LOCAL_MACHINE\SOFTWARE\TENCENT\QQ2009\Install") + "\bin\"
End Sub