'///////////////////////////////////
'界面:
Dim m_strApplication As String '程序路径
StartProcess m_strApplication
'///////////////////////////////////
'模块:
Dim AppInfo As SHELLEXECUTEINFO ' Place holder for Application Information
Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteExA" (lpExecInfo As SHELLEXECUTEINFO) As Boolean
' PRIVATE TYPES
Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
' Optional fields
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Public Function StartProcess(strFile As String)
Dim ret As Boolean ' Return Value
AppInfo.cbSize = Len(AppInfo) ' Length
AppInfo.lpFile = strFile ' File set from a common dialog box
AppInfo.hwnd = frmMain.hwnd ' HWnd of Calling Object
AppInfo.lpVerb = "open" ' String how to handle app
AppInfo.nShow = SW_SHOWNORMAL ' How do we show it?
AppInfo.hProcess = 0 ' set Initial ProcessId
AppInfo.fMask = SEE_MASK_NOCLOSEPROCESS
' Execute the Application
ret = ShellExecuteEx(AppInfo)