Close an Explorer Window in VB .NET

I am running Winzip to extract some files into a folder. When this has completed the parent folder of these files is opened as an explorer window. How can I close this window programatically in VB .NET using the title of the Window?
Blowfelt82Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Blowfelt82Author Commented:
Its the right idea but I am using Windows Explorer not Internet Explorer, so I dont think that each folder window that is open is handled as a seperate process but instead is all handled by the explorer.exe process. In task manager within the Applications tab there is an entry for each of the folders, but in the processes tab only explorer.exe is displayed.
0
halfbloodprinceCommented:
Try calling this subroutine:
Private Sub KillProcess()
For Each clsProcess As Process In Process.GetProcesses
If clsProcess.ProcessName.ToLower.StartsWith("explorer") Then
clsProcess.Kill()
Next
End Sub
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Blowfelt82Author Commented:
That will just shut down explorer which is not what I want to do... I want to shutdown a specific explorer window. For example if I press {Windows} + E, how could I then use VB .NET code to shut this down?
0
gamarrojgqCommented:
Hi,

If you are using Shell to call Winzip you can try SendKeys like this:

SendKeys.Send("%{F4}")

this emulates Alt+F4
0
Blowfelt82Author Commented:
I have found the solution to this... By using the following code...

objProcess.MainWindowHandle = IntPtr.Zero

You can determine whether a Window is visible to the user, rather than a process running in the background.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.