Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Comment enlever le son lors de l'ouverture du MsgBox ???

5 réponses
Avatar
hken
Tout est dit dans la question !!!!
je ne suis pas certain que ce soin possible...
Si quelqu'un peut m'aiguiller..

--
Merci d''''avance pour vos réponses !!

5 réponses

Avatar
Patrick Philippot
Bonjour,

Tout est dit dans la question !!!!
je ne suis pas certain que ce soin possible...
Si quelqu'un peut m'aiguiller..



C'est l'utilisateur qui décide de ça en éditant les modèles de sons dans
Panneau de configuration | Sons et périphériques | Sons. Pour les
changer par programme, il faut bricoler dans la registry
(HKEY_CURRENT_USERAppEventsSchemes). Je ne pense pas qu'il y ait une
API pour accéder à ces données.

--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr
Avatar
Christian Hugoud
Tu peux faire ta propre msgbox.

Christian

"Patrick Philippot" a écrit dans le
message de news:
Bonjour,

Tout est dit dans la question !!!!
je ne suis pas certain que ce soin possible...
Si quelqu'un peut m'aiguiller..



C'est l'utilisateur qui décide de ça en éditant les modèles de sons dans
Panneau de configuration | Sons et périphériques | Sons. Pour les changer
par programme, il faut bricoler dans la registry
(HKEY_CURRENT_USERAppEventsSchemes). Je ne pense pas qu'il y ait une API
pour accéder à ces données.

--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr



Avatar
Jacques93
hken a écrit :
Tout est dit dans la question !!!!
je ne suis pas certain que ce soin possible...
Si quelqu'un peut m'aiguiller..




Si, si on peut, sans son, ou avec un son personnalisé. J'ai utilisé
WshShell.RegRead et WshShell.RegWrite pour alléger le code, mais on peut
les remplacer par les API du registre. Le son n'est modifié que pendant
l'affichage du MessageBox.

arlette.wav : http://cjoint.com/?kBuwoRhtI8

Private Sub Command1_Click()
Dim rep As String
rep = SilentBox("Je suis MUET !!!" & vbCrLf & _
"Au secours !!!", _
vbQuestion Or vbOKCancel, , "arlette.wav")
End Sub

Private Function SilentBox(Msg As String, _
Optional Prm As VbMsgBoxStyle = vbOKOnly, _
Optional Title As String = "", _
Optional Sound As String = "") As Integer
Const cDefaut = _
"HKCUAppEventsSchemesApps.Default.Default.Current"
Const cInformation = _
"HKCUAppEventsSchemesApps.DefaultSystemAsterisk.Current"
Const cExclamation = _
"HKCUAppEventsSchemesApps.DefaultSystemExclamation.Current"
Const cQuestion = _
"HKCUAppEventsSchemesApps.DefaultSystemQuestion.Current"
Const cCritical = _
"HKCUAppEventsSchemesApps.DefaultSystemHand.Current"

Dim WshShell As Object
Dim SonDefaut As String
Dim SonInformation As String
Dim SonExclamation As String
Dim SonQuestion As String
Dim SonCritical As String

Set WshShell = CreateObject("WScript.Shell")
SonDefaut = WshShell.RegRead(cDefaut)
SonInformation = WshShell.RegRead(cInformation)
SonExclamation = WshShell.RegRead(cExclamation)
SonQuestion = WshShell.RegRead(cQuestion)
SonCritical = WshShell.RegRead(cCritical)

'MsgBox "Son Defaut : " & SonDefaut & vbCrLf & _
' "Son Information : " & SonInformation & vbCrLf & _
' "Son Exclamation : " & SonExclamation & vbCrLf & _
' "Son Question : " & SonQuestion & vbCrLf & _
' "Son Critical : " & SonCritical

If Len(Sound) > 0 Then Sound = App.Path & "" & Sound
WshShell.RegWrite cDefaut, Sound
WshShell.RegWrite cInformation, Sound
WshShell.RegWrite cExclamation, Sound
WshShell.RegWrite cQuestion, Sound
WshShell.RegWrite cCritical, Sound

SilentBox = MsgBox(Msg, Prm, IIf(Title = "", App.EXEName, Title))

WshShell.RegWrite cDefaut, SonDefaut, "REG_EXPAND_SZ"
WshShell.RegWrite cInformation, SonInformation, "REG_EXPAND_SZ"
WshShell.RegWrite cExclamation, SonExclamation, "REG_EXPAND_SZ"
WshShell.RegWrite cQuestion, SonQuestion, "REG_EXPAND_SZ"
WshShell.RegWrite cCritical, SonCritical, "REG_EXPAND_SZ"
End Function


--
Cordialement,

Jacques.
Avatar
Jacques93
Oups !
Private Sub Command1_Click()
Dim rep As String



Dim rep as Integer

--
Cordialement,

Jacques.
Avatar
hken
Comme d'habitude c'est niquel !!!
Toi tu touche vraiment ta bille quand même...

Merci à toi Jacques 93.