楼上同位的都不好,还是我的好, 给分吧!
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 先声明这个API 然后
ShellExecute Me.hwnd, "Open", "EXE文件路径", "", App.Path, 1
很不错的,我一直在用这个函数,,给分
Declare Function WinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
说明
运行指定的程序
返回值
Long,大于32表示成功,请参考FindExecutable函数
参数表
参数 类型及说明
lpCmdLine String,包含要执行的命令行
nCmdShow Long,定义了以怎样的形式启动程序的常数值。参考ShowWindow函数的nCmdShow参数