Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open an Explorer Window and Wait for it to close

Status
Not open for further replies.

vacunita

Programmer
Aug 2, 2001
9,166
MX
I need to open an Explorer Window so the user can drag n drop stuff there, but i need to know when the window closes so i can clean up a couple things afterwards, i'm using this code but it doesn't work how it is supposed to.
Dim oShl As New IWshShell_Class
Call oShl.Run("explorer.exe x:\", SW_SHOWNORMAL, True)
Call oShl.Popup("The Explorer Window has been closed", 4, "WSH Example", vbInformation)

it goes straight to the .popup part.
If i substitute explorer.exe with any other app it runs the app but doesn't show it, it just gives it a windowless proccess. that i have to terminate from the taskmanager.

I need it to open the explorer window and wait for it to close.

Any ideas how to go about this?

thanx in advance
 
Check out "ShellExecuteEx" and "WaitForSingleObject" API calls. There are plenty of examples on the web and probably on TT too.

Hope that helps

Regards

Daren


Must think of a witty signature
 
Yes i've found several examples, the only problem is that they seem to wait for any application to finish except for an explorer window. Which is what i want it to wait for, any ideas?
 
I've found alot of examples on this, but all of them seem to work the same way,. They wait for any app, except explorer. I need something that will wait for an explorer window to close before continuing.

Any ideas would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top