Vb.net 进程WaitForExit()未等待Windows资源管理器关闭

Vb.net 进程WaitForExit()未等待Windows资源管理器关闭,vb.net,explorer,waitforexit,Vb.net,Explorer,Waitforexit,下面的代码是我试图打开Windows资源管理器,然后等待用户关闭它,然后再继续程序 这可以使用Notepad.exe工作,但不能使用Exlorer.exe Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim newProc As Diagnostics.Process 'newProc = Diagnostics.Process.Start("Notepad.e

下面的代码是我试图打开Windows资源管理器,然后等待用户关闭它,然后再继续程序

这可以使用Notepad.exe工作,但不能使用Exlorer.exe

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim newProc As Diagnostics.Process
    'newProc = Diagnostics.Process.Start("Notepad.exe") 'This works
    newProc = Diagnostics.Process.Start("Explorer.exe") 'This does not work
    newProc.WaitForExit()
    MsgBox("Continue Processing")
端接头


谢谢您的帮助

它已经打开了。Explorer是一个单例进程。您没有要求它执行任何操作,因此它会在没有看到任何更改的情况下再次快速终止。感谢您解释我的代码无法工作的原因。当用户关闭程序打开的资源管理器窗口/实例时,是否有任何方法可以检测到?