Wave sound files for system events are stored in the registry and they were there with Windows 95, so compatibility is not a problem.
Check this registry key for sounds that play for events:
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default
For the pop-up menu, as you said, you can read the default value from this registry key:
HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\MenuPopup\.Current
So you should write code like this:
Dim rk = Registry.CurrentUser.OpenSubKey("AppEvents\Schemes\Apps\.Default\" & _
"MenuPopup\.Current")
Dim soundFile = rk.GetValue("")
If soundFile <> "" Then
My.Computer.Audio.Play(soundFile)
End If
I checked if the variable was soundFileempty before playing it, because not every event can have a sound associated with it, and you do not want your application to stop working due to a sound file that cannot be found.
source
share