Jump to content

Sons do Webbrowser.


MrGil
 Share

Recommended Posts

Boas,

Existe alguma forma de fazer com que o Webbrowser não emita nenhum som (Como aquele "clique" quando se muda de pagina)

Eu já andei à procura, e o melhor que encontrei foi isto:

Public Class WebClickSound
        ''' <summary>
        ''' Enables or disables the web browser navigating click sound.
        ''' </summary>
        Public Shared Property Enabled() As Boolean
            Get
                Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("AppEvents\Schemes\Apps\Explorer\Navigating\.Current")
                Dim keyValue As String = DirectCast(key.GetValue(Nothing), String)
                Return [string].IsNullOrEmpty(keyValue) = False AndAlso keyValue <> """"""
            End Get
            Set(ByVal value As Boolean)
                Dim keyValue As String

                If value Then
                    keyValue = "%SystemRoot%\Media\"
                    If Environment.OSVersion.Version.Major = 5 AndAlso Environment.OSVersion.Version.Minor > 0 Then
                        ' XP
                        keyValue += "Windows XP Start.wav"
                    ElseIf Environment.OSVersion.Version.Major = 6 Then
                        ' Vista
                        keyValue += "Windows Navigation Start.wav"
                    Else
                        MsgBox("Acontece")
                        ' Don't know the file name so I won't be able to re-enable it
                        Return
                    End If
                Else
                    keyValue = """"""
                End If

                ' Open and set the key that points to the file
                Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("AppEvents\Schemes\Apps\Explorer\Navigating\.Current", True)
                key.SetValue(Nothing, keyValue, RegistryValueKind.ExpandString)
                'isEnabled = value
            End Set
        End Property
    End Class

Mas não funciona... Existe alguma maneira simples de o fazer?

Obrigado pela atenção

Link to comment
Share on other sites

Public Sub DisableSound()
        Dim keyValue As String
        keyValue = "%SystemRoot%\Media\"
        If Environment.OSVersion.Version.Major = 5 AndAlso Environment.OSVersion.Version.Minor > 0 Then
            keyValue += "Windows XP Start.wav"
        ElseIf Environment.OSVersion.Version.Major = 6 Then
            keyValue += "Windows Navigation Start.wav"
        Else
            Return
        End If
        Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("AppEvents\Schemes\Apps\Explorer\Navigating\.Current", True)
        key.SetValue(Nothing, "", Microsoft.Win32.RegistryValueKind.ExpandString)
    End Sub
    Public Sub EnableSound()
        Dim keyValue As String
        keyValue = "%SystemRoot%\Media\"
        If Environment.OSVersion.Version.Major = 5 AndAlso Environment.OSVersion.Version.Minor > 0 Then
            keyValue += "Windows XP Start.wav"
        ElseIf Environment.OSVersion.Version.Major = 6 Then
            keyValue += "Windows Navigation Start.wav"
        Else
            Return
        End If
        Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("AppEvents\Schemes\Apps\Explorer\Navigating\.Current", True)
        key.SetValue(Nothing, keyValue, Microsoft.Win32.RegistryValueKind.ExpandString)
    End Sub

com calma e sem stresses

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.