#If VBA7 And Win64 Then
Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
#Else
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
#End If
Public Const APPCOMMAND_VOLUME_UP = &H302 ' Commande pour augmenter le volume
Public Const WM_APPCOMMAND = &H319 ' Message pour envoyer la commande
Sub AugmenterVolume()
Dim lVolume As Long
Dim lResult As Long
lVolume = 65535 ' Valeur maximale pour un volume fort
lResult = SendMessage(HWND_BROADCAST, WM_APPCOMMAND, 0, APPCOMMAND_VOLUME_UP * &H10000 + lVolume * &HFFFF)
End Sub