I have code that is written to disable a notification sound after a website loads.
The issue is I do not know what the Name of that Notification Sound is.
I have tried just Notification by setting it to "nothing" with the control panel NO Luck.
Here is the code FWIW it is hard to write code if you do not know the names of the Ctr you want to apply changes to. So here is my best guess code.
Module Module1
Sub Main()
Dim webPAGE As String = "http://www.example.com"
OpenWebPage(webPAGE)
End Sub
Sub OpenWebPage(ByVal url As String)
Try
Dim startInfo As New ProcessStartInfo("chrome.exe", url)
startInfo.UseShellExecute = True
Process.Start(startInfo)
Catch ex As Exception
Console.WriteLine("An error occurred: " & ex.Message)
End Try
End Sub
End Module
UseShellExecutetoTrueand then specify an executable as the file to run. The whole point ofUseShellExecuteis that you can specify a resource to open and let the Windows shell decide how to open it. If you specifically want to open the URL in Chrome then just callProcess.Startand pass the EXE name and the URL as arguments. You only needUseShellExecuteset toTrueif you specify the URL as the file name and let the OS open it in the user's default browser.UseShellExecutewill beTrueby default for a .NET Framework app anyway. It will beFalseby default for a .NET Core (including .NET 5 and later) app though.