when a messagebox comes up on the screen, you hear the default sound, is there anyway whereby that sound can be removed and then a custom sound can be used instead?
Printable View
when a messagebox comes up on the screen, you hear the default sound, is there anyway whereby that sound can be removed and then a custom sound can be used instead?
Try this:
VB Code:
Option Explicit Dim a As Long, i As Long, tmp As String, original As Long, vol As String Private Declare Function waveOutSetVolume Lib "Winmm" _ (ByVal wDeviceID As Integer, ByVal dwVolume As Long) As Integer Private Declare Function waveOutGetVolume Lib "Winmm" _ (ByVal wDeviceID As Integer, dwVolume As Long) As Integer Private Sub Command1_Click() a = waveOutGetVolume(0, i) tmp = "&h" & Right(Hex$(i), 4) original = CLng(tmp) vol = 0 tmp = Right((Hex$(vol + 65536)), 4) vol = CLng("&H" & tmp & tmp) a = waveOutSetVolume(0, vol) MsgBox "No sound...", vbExclamation vol = original tmp = Right((Hex$(vol + 65536)), 4) vol = CLng("&H" & tmp & tmp) a = waveOutSetVolume(0, vol) MsgBox "Original sound volume!", vbExclamation End Sub
i am not as advanced in vb as you are :) but it looks like the code turns sound on and off?Quote:
Originally Posted by gavio
create your own message box from a form - it gives you much more flexibility
Isn't that what you wanted? It sets the volume back to what it was. I don't think there is any other way to do it, unless you create your own message box as Bush proposed ;)Quote:
Originally Posted by BrailleSchool
that might be the way to go... create own msgbox
ill do that once ive completed my app. have a lot done but still a lot more to go :) thanks guys.