Jump to content

Como fechar janela do Microsoft Edge


programadorvb6
 Share

Go to solution Solved by programadorvb6,

Recommended Posts

programadorvb6

Como fechar todas as janelas que estejam abertas no Microsoft Edge?
Fiz um código assim mas não deu para as fechar.
 

 Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("iexplore")

        For Each p As Process In pProcess
            p.Kill()
        Next
        Me.Close()
    End Sub

Grato pela vossa atenção.

 

Edited by programadorvb6

______________________________________________________________________________

Que minha coragem seja maior que meu medo e que minha força seja tão grande quanto minha fé.
 

Link to comment
Share on other sites

  • Solution
programadorvb6
   ' Fecha Microsoft Edge
        Dim Edge As Process() = Process.GetProcessesByName("MicrosoftEdge")
        For Each Item As Process In Edge
            Try
                Item.Kill()
                Item.WaitForExit(3000)
            Catch generatedExceptionName As Exception
            End Try
        Next
        Me.Close()

______________________________________________________________________________

Que minha coragem seja maior que meu medo e que minha força seja tão grande quanto minha fé.
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.