Private Declare
Function
GetDesktopWindow
Lib
"user32"
() As Long
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
Sub
zmRunApp(程序路径)
Dim
p, DirPath, FileName
p =
InStrRev
(程序路径, "\")
DirPath =
Left
(程序路径, p)
FileName =
Right
(程序路径,
Len
(程序路径) - p)
ShellExecute GetDesktopWindow,
"open"
, FileName, vbNullString, DirPath, 5
End
Sub
zmRunApp
"C:\Program Files (x86)\Tencent\QQ\Bin\QQ.exe"