http://community.csdn.net/Expert/topic/4974/4974137.xml?temp=.4198877
'为了使用方便,修改了CreateProcess的声明
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Private Const INFINITE = &HFFFF ' Infinite timeout
Private Sub Form_Load()
Dim sui As STARTUPINFO
Dim pi As PROCESS_INFORMATION
sui.cb = Len(sui)
CreateProcess "SETUP_A.EXE", vbNullString, 0&, 0&, 0&, 0&, ByVal 0&, vbNullString, sui, pi
WaitForSingleObject pi.hProcess, INFINITE
Shell "SETUP_B.EXE"
End Sub