Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Sub Form_Load()
Dim lngPId As Long
Dim lngPHandle As Long
lngPId = Shell("Notepad.exe", vbNormalFocus)
lngPHandle = OpenProcess(SYNCHRONIZE, 0, lngPId)
If lngPHandle = 0 Then
Call WaitForSingleObject(lngPHandle, INFINITE) ' 无限等待, 直到程式结束
Call CloseHandle(lngPHandle)
End If
Call Shell("d:\test3\select.exe", vbHide)
End Sub
应该不冲突吧 你只管执行就没问题吧....楼上正解