Je cherche comment gérer le volume général, sans bouger le "slider",
juste entrer en saisie une valeur en pourcentage (je parle du volume
général, celui d'en bas à droite de la barre de tâches)...
Je dois dire que j'ai déjà un truc que François m'avait passé, qui gère
le volume et le slider, mais il y en a une telle tartine que je ne comprend
absolument rien! En plus j'ai pas de doc, et puis je parle pas trop anglais,
désolé, je sais, je ne suis pas normal, je devrais parler l'anglais en
France, et comme ça les chinois vont parler français, lol...
Voici le code, si quelqu'un peut me l'épurer pour juste gérer dans une FORM
(une frm, pas un module, lol, étrange manie de faire des fonction à
profusion pour économiser de ridicules variables, et de balancer des tas de
trucs dans les modules qui restent en mémoire, [pas de Dudule, les variables
publics marchent très bien] :o), j'veux juste 1 feuille, svp :o), juste le
volume, sans rien d'autre, juste ça, merci et... heu... bon courage
--form------------------
vol = Module1.GetVolume
sldVolume.Min = vol.Min
sldVolume.Max = vol.Max
sldVolume.TickFrequency = (vol.Max - vol.Min) / 10
sldVolume.Value = sldVolume.Max - vol.Volume 'Le max en haut
sldVolume.SmallChange = (vol.Max - vol.Min) / 100
sldVolume.LargeChange = (vol.Max - vol.Min) / 10
If Module1.GetVolumeMute Then
chkMute.Value = vbChecked
Else
chkMute.Value = vbUnchecked
End If
Dim hWndToolTip As Long
hWndToolTip = SendMessage(sldVolume.hwnd, TBM_GETTOOLTIPS, 0, ByVal 0&)
SendMessage hWndToolTip, TTM_ACTIVATE, 0, ByVal 0&
Private Declare Function mixerClose _
Lib "winmm.dll" ( _
ByVal hmx As Long _
) As Long
Private Declare Function mixerGetControlDetails _
Lib "winmm.dll" _
Alias "mixerGetControlDetailsA" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long
Private Declare Function mixerGetLineControls _
Lib "winmm.dll" _
Alias "mixerGetLineControlsA" ( _
ByVal hmxobj As Long, _
pmxlc As MIXERLINECONTROLS, _
ByVal fdwControls As Long _
) As Long
Private Declare Function mixerGetLineInfo _
Lib "winmm.dll" _
Alias "mixerGetLineInfoA" ( _
ByVal hmxobj As Long, _
pmxl As MIXERLINE, _
ByVal fdwInfo As Long _
) As Long
Private Declare Function mixerOpen _
Lib "winmm.dll" ( _
phmx As Long, _
ByVal uMxId As Long, _
ByVal dwCallback As Long, _
ByVal dwInstance As Long, _
ByVal fdwOpen As Long _
) As Long
Private Declare Function mixerSetControlDetails _
Lib "winmm.dll" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long
Private Type MIXERCAPS
wMid As Integer ' manufacturer id
wPid As Integer ' product id
vDriverVersion As Long ' version of the driver
szPname As String * MAXPNAMELEN ' product name
fdwSupport As Long ' misc. support bits
cDestinations As Long ' count of destinations
End Type
Type MIXERCONTROL
cbStruct As Long ' size in Byte of MIXERCONTROL
dwControlID As Long ' unique control id for mixer device
dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx
fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set
szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte ' short name of
control
szName(1 To MIXER_LONG_NAME_CHARS) As Byte ' long name of
control
lMinimum As Long ' Minimum value
lMaximum As Long ' Maximum value
reserved(10) As Long ' reserved structure space
End Type
Private Type MIXERCONTROLDETAILS
cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
dwControlID As Long ' control id to get/set details on
cChannels As Long ' number of channels in paDetails array
item As Long ' hwndOwner or cMultipleItems
cbDetails As Long ' size of _one_ details_XX struct
paDetails As Long ' pointer to array of details_XX structs
End Type
Private Type MIXERCONTROLDETAILS_UNSIGNED
dwValue As Long ' value of the control
End Type
Private Type MIXERCONTROLDETAILS_BOOLEAN
fValue As Long
End Type
Private Type MIXERLINE
cbStruct As Long ' size of MIXERLINE structure
dwDestination As Long ' zero based destination index
dwSource As Long ' zero based source index (if source)
dwLineID As Long ' unique line id for mixer device
fdwLine As Long ' state/information about line
dwUser As Long ' driver specific information
dwComponentType As Long ' component type line connects to
cChannels As Long ' number of channels line supports
cConnections As Long ' number of connections (possible)
cControls As Long ' number of controls at this line
szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte
szName(1 To MIXER_LONG_NAME_CHARS) As Byte
dwType As Long
dwDeviceID As Long
wMid As Integer
wPid As Integer
vDriverVersion As Long
szPname As String * MAXPNAMELEN
End Type
Private Type MIXERLINECONTROLS
cbStruct As Long ' size in Byte of MIXERLINECONTROLS
dwLineID As Long ' line id (from MIXERLINE.dwLineID)
' MIXER_GETLINECONTROLSF_ONEBYID or
dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE
cControls As Long ' count of controls pmxctrl points to
cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
pamxctrl As Long ' pointer to first MIXERCONTROL array
End Type
Type myVolume
Min As Long
Max As Long
Volume As Long
End Type
Function GetVolume() As myVolume
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then
If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then
GetVolume.Max = mxc.lMaximum
GetVolume.Min = mxc.lMinimum
mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdu)
mxcd.paDetails = VarPtr(mxcdu)
mxcd.cChannels = 1
If mixerGetControlDetails(hMixer, _
mxcd, _
MIXER_GETCONTROLDETAILSF_VALUE) _
= MMSYSERR_NOERROR Then
GetVolume.Volume = mxcdu.dwValue
End If
End If
End If
mixerClose hMixer
End If
End Function
Sub SetVolume(NewVolume As Long)
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then
mixerSetControlDetails hMixer, _
mxcd, _
MIXER_SETCONTROLDETAILSF_VALUE
End If
End If
mixerClose hMixer
End If
End Sub
Function GetVolumeMute() As Boolean
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then
If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then
mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdb)
mxcd.paDetails = VarPtr(mxcdb)
mxcd.cChannels = 1
If mixerGetControlDetails(hMixer, _
mxcd, _
MIXER_GETCONTROLDETAILSF_VALUE) _
= MMSYSERR_NOERROR Then
GetVolumeMute = mxcdb.fValue
End If
End If
End If
mixerClose hMixer
End If
End Function
Sub SetVolumeMute(Mute As Boolean)
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then
mixerSetControlDetails hMixer, _
mxcd, _
MIXER_SETCONTROLDETAILSF_VALUE
End If
End If
mixerClose hMixer
End If
End Sub
--
Merci, @+, bye, Joe
troll75 AROBASE iFrance POINT com
------------------------------------------
Ce message est plein de virus "certifiés"
Le_Troll, éleveur de Trolls depuis César, qui disait:
Avec une hache, celui qui tient le manche a toujours raison !
------------------------------------------
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Cedric
Bonjour,
Si tu veux regler le volume general de windows sans slider, juste avec un bouton tu peux utiliser le code suivant (trouvé sur VBfrance.com):
Private Sub Command1_Click() r = Shell("sndvol32 /t") ' Affiche la petite fenêtre volume de windows End Sub
Comme tu peux le constater ce code ne fait pas appel aux API de ton OS. il utilise seulement Sndvol32 (ce qui permet de regler le volume general du systeme d'exploitation)
Si
"le_troll" a écrit :
Bonjour chers amis,
Je cherche comment gérer le volume général, sans bouger le "slider", juste entrer en saisie une valeur en pourcentage (je parle du volume général, celui d'en bas à droite de la barre de tâches)...
Je dois dire que j'ai déjà un truc que François m'avait passé, qui gère le volume et le slider, mais il y en a une telle tartine que je ne comprend absolument rien! En plus j'ai pas de doc, et puis je parle pas trop anglais, désolé, je sais, je ne suis pas normal, je devrais parler l'anglais en France, et comme ça les chinois vont parler français, lol... Voici le code, si quelqu'un peut me l'épurer pour juste gérer dans une FORM (une frm, pas un module, lol, étrange manie de faire des fonction à profusion pour économiser de ridicules variables, et de balancer des tas de trucs dans les modules qui restent en mémoire, [pas de Dudule, les variables publics marchent très bien] :o), j'veux juste 1 feuille, svp :o), juste le volume, sans rien d'autre, juste ça, merci et... heu... bon courage --form------------------ vol = Module1.GetVolume sldVolume.Min = vol.Min sldVolume.Max = vol.Max sldVolume.TickFrequency = (vol.Max - vol.Min) / 10 sldVolume.Value = sldVolume.Max - vol.Volume 'Le max en haut sldVolume.SmallChange = (vol.Max - vol.Min) / 100 sldVolume.LargeChange = (vol.Max - vol.Min) / 10 If Module1.GetVolumeMute Then chkMute.Value = vbChecked Else chkMute.Value = vbUnchecked End If Dim hWndToolTip As Long hWndToolTip = SendMessage(sldVolume.hwnd, TBM_GETTOOLTIPS, 0, ByVal 0&) SendMessage hWndToolTip, TTM_ACTIVATE, 0, ByVal 0&
Private Declare Function mixerClose _ Lib "winmm.dll" ( _ ByVal hmx As Long _ ) As Long
Private Declare Function mixerGetControlDetails _ Lib "winmm.dll" _ Alias "mixerGetControlDetailsA" ( _ ByVal hmxobj As Long, _ pmxcd As MIXERCONTROLDETAILS, _ ByVal fdwDetails As Long _ ) As Long
Private Declare Function mixerGetLineControls _ Lib "winmm.dll" _ Alias "mixerGetLineControlsA" ( _ ByVal hmxobj As Long, _ pmxlc As MIXERLINECONTROLS, _ ByVal fdwControls As Long _ ) As Long
Private Declare Function mixerGetLineInfo _ Lib "winmm.dll" _ Alias "mixerGetLineInfoA" ( _ ByVal hmxobj As Long, _ pmxl As MIXERLINE, _ ByVal fdwInfo As Long _ ) As Long
Private Declare Function mixerOpen _ Lib "winmm.dll" ( _ phmx As Long, _ ByVal uMxId As Long, _ ByVal dwCallback As Long, _ ByVal dwInstance As Long, _ ByVal fdwOpen As Long _ ) As Long
Private Declare Function mixerSetControlDetails _ Lib "winmm.dll" ( _ ByVal hmxobj As Long, _ pmxcd As MIXERCONTROLDETAILS, _ ByVal fdwDetails As Long _ ) As Long
Private Type MIXERCAPS wMid As Integer ' manufacturer id wPid As Integer ' product id vDriverVersion As Long ' version of the driver szPname As String * MAXPNAMELEN ' product name fdwSupport As Long ' misc. support bits cDestinations As Long ' count of destinations End Type
Type MIXERCONTROL cbStruct As Long ' size in Byte of MIXERCONTROL dwControlID As Long ' unique control id for mixer device dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte ' short name of control szName(1 To MIXER_LONG_NAME_CHARS) As Byte ' long name of control lMinimum As Long ' Minimum value lMaximum As Long ' Maximum value reserved(10) As Long ' reserved structure space End Type
Private Type MIXERCONTROLDETAILS cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS dwControlID As Long ' control id to get/set details on cChannels As Long ' number of channels in paDetails array item As Long ' hwndOwner or cMultipleItems cbDetails As Long ' size of _one_ details_XX struct paDetails As Long ' pointer to array of details_XX structs End Type
Private Type MIXERCONTROLDETAILS_UNSIGNED dwValue As Long ' value of the control End Type Private Type MIXERCONTROLDETAILS_BOOLEAN fValue As Long End Type
Private Type MIXERLINE cbStruct As Long ' size of MIXERLINE structure dwDestination As Long ' zero based destination index dwSource As Long ' zero based source index (if source) dwLineID As Long ' unique line id for mixer device fdwLine As Long ' state/information about line dwUser As Long ' driver specific information dwComponentType As Long ' component type line connects to cChannels As Long ' number of channels line supports cConnections As Long ' number of connections (possible) cControls As Long ' number of controls at this line szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte szName(1 To MIXER_LONG_NAME_CHARS) As Byte dwType As Long dwDeviceID As Long wMid As Integer wPid As Integer vDriverVersion As Long szPname As String * MAXPNAMELEN End Type
Private Type MIXERLINECONTROLS cbStruct As Long ' size in Byte of MIXERLINECONTROLS dwLineID As Long ' line id (from MIXERLINE.dwLineID) ' MIXER_GETLINECONTROLSF_ONEBYID or dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE cControls As Long ' count of controls pmxctrl points to cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL pamxctrl As Long ' pointer to first MIXERCONTROL array End Type
Type myVolume Min As Long Max As Long Volume As Long End Type
Function GetVolume() As myVolume Dim hMixer As Long Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim mxc As MIXERCONTROL Dim mxcd As MIXERCONTROLDETAILS Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR Then mxl.cbStruct = Len(mxl) mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _ mxl, _ MIXER_GETLINEINFOF_COMPONENTTYPE) _ = MMSYSERR_NOERROR Then
If mixerGetLineControls(hMixer, _ mxlc, _ MIXER_GETLINECONTROLSF_ONEBYTYPE) _ = MMSYSERR_NOERROR Then
GetVolume.Max = mxc.lMaximum GetVolume.Min = mxc.lMinimum mxcd.dwControlID = mxc.dwControlID mxcd.cbStruct = Len(mxcd) mxcd.item = 0 mxcd.cbDetails = Len(mxcdu) mxcd.paDetails = VarPtr(mxcdu) mxcd.cChannels = 1 If mixerGetControlDetails(hMixer, _ mxcd, _ MIXER_GETCONTROLDETAILSF_VALUE) _ = MMSYSERR_NOERROR Then GetVolume.Volume = mxcdu.dwValue End If End If End If
mixerClose hMixer End If End Function
Sub SetVolume(NewVolume As Long) Dim hMixer As Long Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim mxc As MIXERCONTROL Dim mxcd As MIXERCONTROLDETAILS Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR Then mxl.cbStruct = Len(mxl) mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _ mxl, _ MIXER_GETLINEINFOF_COMPONENTTYPE) _ = MMSYSERR_NOERROR Then
mixerSetControlDetails hMixer, _ mxcd, _ MIXER_SETCONTROLDETAILSF_VALUE End If End If
mixerClose hMixer End If End Sub
Function GetVolumeMute() As Boolean Dim hMixer As Long Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim mxc As MIXERCONTROL Dim mxcd As MIXERCONTROLDETAILS Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR Then mxl.cbStruct = Len(mxl) mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _ mxl, _ MIXER_GETLINEINFOF_COMPONENTTYPE) _ = MMSYSERR_NOERROR Then
If mixerGetLineControls(hMixer, _ mxlc, _ MIXER_GETLINECONTROLSF_ONEBYTYPE) _ = MMSYSERR_NOERROR Then
mxcd.dwControlID = mxc.dwControlID mxcd.cbStruct = Len(mxcd) mxcd.item = 0 mxcd.cbDetails = Len(mxcdb) mxcd.paDetails = VarPtr(mxcdb) mxcd.cChannels = 1 If mixerGetControlDetails(hMixer, _ mxcd, _ MIXER_GETCONTROLDETAILSF_VALUE) _ = MMSYSERR_NOERROR Then GetVolumeMute = mxcdb.fValue End If End If End If
mixerClose hMixer End If End Function
Sub SetVolumeMute(Mute As Boolean) Dim hMixer As Long Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim mxc As MIXERCONTROL Dim mxcd As MIXERCONTROLDETAILS Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR Then mxl.cbStruct = Len(mxl) mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _ mxl, _ MIXER_GETLINEINFOF_COMPONENTTYPE) _ = MMSYSERR_NOERROR Then
mixerSetControlDetails hMixer, _ mxcd, _ MIXER_SETCONTROLDETAILSF_VALUE End If End If
mixerClose hMixer End If End Sub
-- Merci, @+, bye, Joe troll75 AROBASE iFrance POINT com ------------------------------------------ Ce message est plein de virus "certifiés" Le_Troll, éleveur de Trolls depuis César, qui disait: Avec une hache, celui qui tient le manche a toujours raison ! ------------------------------------------
Bonjour,
Si tu veux regler le volume general de windows sans slider, juste avec un bouton tu peux utiliser le code suivant (trouvé sur VBfrance.com):
Private Sub Command1_Click()
r = Shell("sndvol32 /t") ' Affiche la petite fenêtre volume de windows
End Sub
Comme tu peux le constater ce code ne fait pas appel aux API de ton OS. il utilise seulement Sndvol32 (ce qui permet de regler le volume general du systeme d'exploitation)
Si
"le_troll" a écrit :
Bonjour chers amis,
Je cherche comment gérer le volume général, sans bouger le "slider",
juste entrer en saisie une valeur en pourcentage (je parle du volume
général, celui d'en bas à droite de la barre de tâches)...
Je dois dire que j'ai déjà un truc que François m'avait passé, qui gère
le volume et le slider, mais il y en a une telle tartine que je ne comprend
absolument rien! En plus j'ai pas de doc, et puis je parle pas trop anglais,
désolé, je sais, je ne suis pas normal, je devrais parler l'anglais en
France, et comme ça les chinois vont parler français, lol...
Voici le code, si quelqu'un peut me l'épurer pour juste gérer dans une FORM
(une frm, pas un module, lol, étrange manie de faire des fonction à
profusion pour économiser de ridicules variables, et de balancer des tas de
trucs dans les modules qui restent en mémoire, [pas de Dudule, les variables
publics marchent très bien] :o), j'veux juste 1 feuille, svp :o), juste le
volume, sans rien d'autre, juste ça, merci et... heu... bon courage
--form------------------
vol = Module1.GetVolume
sldVolume.Min = vol.Min
sldVolume.Max = vol.Max
sldVolume.TickFrequency = (vol.Max - vol.Min) / 10
sldVolume.Value = sldVolume.Max - vol.Volume 'Le max en haut
sldVolume.SmallChange = (vol.Max - vol.Min) / 100
sldVolume.LargeChange = (vol.Max - vol.Min) / 10
If Module1.GetVolumeMute Then
chkMute.Value = vbChecked
Else
chkMute.Value = vbUnchecked
End If
Dim hWndToolTip As Long
hWndToolTip = SendMessage(sldVolume.hwnd, TBM_GETTOOLTIPS, 0, ByVal 0&)
SendMessage hWndToolTip, TTM_ACTIVATE, 0, ByVal 0&
Private Declare Function mixerClose _
Lib "winmm.dll" ( _
ByVal hmx As Long _
) As Long
Private Declare Function mixerGetControlDetails _
Lib "winmm.dll" _
Alias "mixerGetControlDetailsA" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long
Private Declare Function mixerGetLineControls _
Lib "winmm.dll" _
Alias "mixerGetLineControlsA" ( _
ByVal hmxobj As Long, _
pmxlc As MIXERLINECONTROLS, _
ByVal fdwControls As Long _
) As Long
Private Declare Function mixerGetLineInfo _
Lib "winmm.dll" _
Alias "mixerGetLineInfoA" ( _
ByVal hmxobj As Long, _
pmxl As MIXERLINE, _
ByVal fdwInfo As Long _
) As Long
Private Declare Function mixerOpen _
Lib "winmm.dll" ( _
phmx As Long, _
ByVal uMxId As Long, _
ByVal dwCallback As Long, _
ByVal dwInstance As Long, _
ByVal fdwOpen As Long _
) As Long
Private Declare Function mixerSetControlDetails _
Lib "winmm.dll" ( _
ByVal hmxobj As Long, _
pmxcd As MIXERCONTROLDETAILS, _
ByVal fdwDetails As Long _
) As Long
Private Type MIXERCAPS
wMid As Integer ' manufacturer id
wPid As Integer ' product id
vDriverVersion As Long ' version of the driver
szPname As String * MAXPNAMELEN ' product name
fdwSupport As Long ' misc. support bits
cDestinations As Long ' count of destinations
End Type
Type MIXERCONTROL
cbStruct As Long ' size in Byte of MIXERCONTROL
dwControlID As Long ' unique control id for mixer device
dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx
fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set
szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte ' short name of
control
szName(1 To MIXER_LONG_NAME_CHARS) As Byte ' long name of
control
lMinimum As Long ' Minimum value
lMaximum As Long ' Maximum value
reserved(10) As Long ' reserved structure space
End Type
Private Type MIXERCONTROLDETAILS
cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
dwControlID As Long ' control id to get/set details on
cChannels As Long ' number of channels in paDetails array
item As Long ' hwndOwner or cMultipleItems
cbDetails As Long ' size of _one_ details_XX struct
paDetails As Long ' pointer to array of details_XX structs
End Type
Private Type MIXERCONTROLDETAILS_UNSIGNED
dwValue As Long ' value of the control
End Type
Private Type MIXERCONTROLDETAILS_BOOLEAN
fValue As Long
End Type
Private Type MIXERLINE
cbStruct As Long ' size of MIXERLINE structure
dwDestination As Long ' zero based destination index
dwSource As Long ' zero based source index (if source)
dwLineID As Long ' unique line id for mixer device
fdwLine As Long ' state/information about line
dwUser As Long ' driver specific information
dwComponentType As Long ' component type line connects to
cChannels As Long ' number of channels line supports
cConnections As Long ' number of connections (possible)
cControls As Long ' number of controls at this line
szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte
szName(1 To MIXER_LONG_NAME_CHARS) As Byte
dwType As Long
dwDeviceID As Long
wMid As Integer
wPid As Integer
vDriverVersion As Long
szPname As String * MAXPNAMELEN
End Type
Private Type MIXERLINECONTROLS
cbStruct As Long ' size in Byte of MIXERLINECONTROLS
dwLineID As Long ' line id (from MIXERLINE.dwLineID)
' MIXER_GETLINECONTROLSF_ONEBYID or
dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE
cControls As Long ' count of controls pmxctrl points to
cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
pamxctrl As Long ' pointer to first MIXERCONTROL array
End Type
Type myVolume
Min As Long
Max As Long
Volume As Long
End Type
Function GetVolume() As myVolume
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then
If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then
GetVolume.Max = mxc.lMaximum
GetVolume.Min = mxc.lMinimum
mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdu)
mxcd.paDetails = VarPtr(mxcdu)
mxcd.cChannels = 1
If mixerGetControlDetails(hMixer, _
mxcd, _
MIXER_GETCONTROLDETAILSF_VALUE) _
= MMSYSERR_NOERROR Then
GetVolume.Volume = mxcdu.dwValue
End If
End If
End If
mixerClose hMixer
End If
End Function
Sub SetVolume(NewVolume As Long)
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then
mixerSetControlDetails hMixer, _
mxcd, _
MIXER_SETCONTROLDETAILSF_VALUE
End If
End If
mixerClose hMixer
End If
End Sub
Function GetVolumeMute() As Boolean
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then
If mixerGetLineControls(hMixer, _
mxlc, _
MIXER_GETLINECONTROLSF_ONEBYTYPE) _
= MMSYSERR_NOERROR Then
mxcd.dwControlID = mxc.dwControlID
mxcd.cbStruct = Len(mxcd)
mxcd.item = 0
mxcd.cbDetails = Len(mxcdb)
mxcd.paDetails = VarPtr(mxcdb)
mxcd.cChannels = 1
If mixerGetControlDetails(hMixer, _
mxcd, _
MIXER_GETCONTROLDETAILSF_VALUE) _
= MMSYSERR_NOERROR Then
GetVolumeMute = mxcdb.fValue
End If
End If
End If
mixerClose hMixer
End If
End Function
Sub SetVolumeMute(Mute As Boolean)
Dim hMixer As Long
Dim mxlc As MIXERLINECONTROLS
Dim mxl As MIXERLINE
Dim mxc As MIXERCONTROL
Dim mxcd As MIXERCONTROLDETAILS
Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR
Then
mxl.cbStruct = Len(mxl)
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _
mxl, _
MIXER_GETLINEINFOF_COMPONENTTYPE) _
= MMSYSERR_NOERROR Then
mixerSetControlDetails hMixer, _
mxcd, _
MIXER_SETCONTROLDETAILSF_VALUE
End If
End If
mixerClose hMixer
End If
End Sub
--
Merci, @+, bye, Joe
troll75 AROBASE iFrance POINT com
------------------------------------------
Ce message est plein de virus "certifiés"
Le_Troll, éleveur de Trolls depuis César, qui disait:
Avec une hache, celui qui tient le manche a toujours raison !
------------------------------------------
Si tu veux regler le volume general de windows sans slider, juste avec un bouton tu peux utiliser le code suivant (trouvé sur VBfrance.com):
Private Sub Command1_Click() r = Shell("sndvol32 /t") ' Affiche la petite fenêtre volume de windows End Sub
Comme tu peux le constater ce code ne fait pas appel aux API de ton OS. il utilise seulement Sndvol32 (ce qui permet de regler le volume general du systeme d'exploitation)
Si
"le_troll" a écrit :
Bonjour chers amis,
Je cherche comment gérer le volume général, sans bouger le "slider", juste entrer en saisie une valeur en pourcentage (je parle du volume général, celui d'en bas à droite de la barre de tâches)...
Je dois dire que j'ai déjà un truc que François m'avait passé, qui gère le volume et le slider, mais il y en a une telle tartine que je ne comprend absolument rien! En plus j'ai pas de doc, et puis je parle pas trop anglais, désolé, je sais, je ne suis pas normal, je devrais parler l'anglais en France, et comme ça les chinois vont parler français, lol... Voici le code, si quelqu'un peut me l'épurer pour juste gérer dans une FORM (une frm, pas un module, lol, étrange manie de faire des fonction à profusion pour économiser de ridicules variables, et de balancer des tas de trucs dans les modules qui restent en mémoire, [pas de Dudule, les variables publics marchent très bien] :o), j'veux juste 1 feuille, svp :o), juste le volume, sans rien d'autre, juste ça, merci et... heu... bon courage --form------------------ vol = Module1.GetVolume sldVolume.Min = vol.Min sldVolume.Max = vol.Max sldVolume.TickFrequency = (vol.Max - vol.Min) / 10 sldVolume.Value = sldVolume.Max - vol.Volume 'Le max en haut sldVolume.SmallChange = (vol.Max - vol.Min) / 100 sldVolume.LargeChange = (vol.Max - vol.Min) / 10 If Module1.GetVolumeMute Then chkMute.Value = vbChecked Else chkMute.Value = vbUnchecked End If Dim hWndToolTip As Long hWndToolTip = SendMessage(sldVolume.hwnd, TBM_GETTOOLTIPS, 0, ByVal 0&) SendMessage hWndToolTip, TTM_ACTIVATE, 0, ByVal 0&
Private Declare Function mixerClose _ Lib "winmm.dll" ( _ ByVal hmx As Long _ ) As Long
Private Declare Function mixerGetControlDetails _ Lib "winmm.dll" _ Alias "mixerGetControlDetailsA" ( _ ByVal hmxobj As Long, _ pmxcd As MIXERCONTROLDETAILS, _ ByVal fdwDetails As Long _ ) As Long
Private Declare Function mixerGetLineControls _ Lib "winmm.dll" _ Alias "mixerGetLineControlsA" ( _ ByVal hmxobj As Long, _ pmxlc As MIXERLINECONTROLS, _ ByVal fdwControls As Long _ ) As Long
Private Declare Function mixerGetLineInfo _ Lib "winmm.dll" _ Alias "mixerGetLineInfoA" ( _ ByVal hmxobj As Long, _ pmxl As MIXERLINE, _ ByVal fdwInfo As Long _ ) As Long
Private Declare Function mixerOpen _ Lib "winmm.dll" ( _ phmx As Long, _ ByVal uMxId As Long, _ ByVal dwCallback As Long, _ ByVal dwInstance As Long, _ ByVal fdwOpen As Long _ ) As Long
Private Declare Function mixerSetControlDetails _ Lib "winmm.dll" ( _ ByVal hmxobj As Long, _ pmxcd As MIXERCONTROLDETAILS, _ ByVal fdwDetails As Long _ ) As Long
Private Type MIXERCAPS wMid As Integer ' manufacturer id wPid As Integer ' product id vDriverVersion As Long ' version of the driver szPname As String * MAXPNAMELEN ' product name fdwSupport As Long ' misc. support bits cDestinations As Long ' count of destinations End Type
Type MIXERCONTROL cbStruct As Long ' size in Byte of MIXERCONTROL dwControlID As Long ' unique control id for mixer device dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte ' short name of control szName(1 To MIXER_LONG_NAME_CHARS) As Byte ' long name of control lMinimum As Long ' Minimum value lMaximum As Long ' Maximum value reserved(10) As Long ' reserved structure space End Type
Private Type MIXERCONTROLDETAILS cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS dwControlID As Long ' control id to get/set details on cChannels As Long ' number of channels in paDetails array item As Long ' hwndOwner or cMultipleItems cbDetails As Long ' size of _one_ details_XX struct paDetails As Long ' pointer to array of details_XX structs End Type
Private Type MIXERCONTROLDETAILS_UNSIGNED dwValue As Long ' value of the control End Type Private Type MIXERCONTROLDETAILS_BOOLEAN fValue As Long End Type
Private Type MIXERLINE cbStruct As Long ' size of MIXERLINE structure dwDestination As Long ' zero based destination index dwSource As Long ' zero based source index (if source) dwLineID As Long ' unique line id for mixer device fdwLine As Long ' state/information about line dwUser As Long ' driver specific information dwComponentType As Long ' component type line connects to cChannels As Long ' number of channels line supports cConnections As Long ' number of connections (possible) cControls As Long ' number of controls at this line szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte szName(1 To MIXER_LONG_NAME_CHARS) As Byte dwType As Long dwDeviceID As Long wMid As Integer wPid As Integer vDriverVersion As Long szPname As String * MAXPNAMELEN End Type
Private Type MIXERLINECONTROLS cbStruct As Long ' size in Byte of MIXERLINECONTROLS dwLineID As Long ' line id (from MIXERLINE.dwLineID) ' MIXER_GETLINECONTROLSF_ONEBYID or dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE cControls As Long ' count of controls pmxctrl points to cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL pamxctrl As Long ' pointer to first MIXERCONTROL array End Type
Type myVolume Min As Long Max As Long Volume As Long End Type
Function GetVolume() As myVolume Dim hMixer As Long Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim mxc As MIXERCONTROL Dim mxcd As MIXERCONTROLDETAILS Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR Then mxl.cbStruct = Len(mxl) mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _ mxl, _ MIXER_GETLINEINFOF_COMPONENTTYPE) _ = MMSYSERR_NOERROR Then
If mixerGetLineControls(hMixer, _ mxlc, _ MIXER_GETLINECONTROLSF_ONEBYTYPE) _ = MMSYSERR_NOERROR Then
GetVolume.Max = mxc.lMaximum GetVolume.Min = mxc.lMinimum mxcd.dwControlID = mxc.dwControlID mxcd.cbStruct = Len(mxcd) mxcd.item = 0 mxcd.cbDetails = Len(mxcdu) mxcd.paDetails = VarPtr(mxcdu) mxcd.cChannels = 1 If mixerGetControlDetails(hMixer, _ mxcd, _ MIXER_GETCONTROLDETAILSF_VALUE) _ = MMSYSERR_NOERROR Then GetVolume.Volume = mxcdu.dwValue End If End If End If
mixerClose hMixer End If End Function
Sub SetVolume(NewVolume As Long) Dim hMixer As Long Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim mxc As MIXERCONTROL Dim mxcd As MIXERCONTROLDETAILS Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR Then mxl.cbStruct = Len(mxl) mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _ mxl, _ MIXER_GETLINEINFOF_COMPONENTTYPE) _ = MMSYSERR_NOERROR Then
mixerSetControlDetails hMixer, _ mxcd, _ MIXER_SETCONTROLDETAILSF_VALUE End If End If
mixerClose hMixer End If End Sub
Function GetVolumeMute() As Boolean Dim hMixer As Long Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim mxc As MIXERCONTROL Dim mxcd As MIXERCONTROLDETAILS Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR Then mxl.cbStruct = Len(mxl) mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _ mxl, _ MIXER_GETLINEINFOF_COMPONENTTYPE) _ = MMSYSERR_NOERROR Then
If mixerGetLineControls(hMixer, _ mxlc, _ MIXER_GETLINECONTROLSF_ONEBYTYPE) _ = MMSYSERR_NOERROR Then
mxcd.dwControlID = mxc.dwControlID mxcd.cbStruct = Len(mxcd) mxcd.item = 0 mxcd.cbDetails = Len(mxcdb) mxcd.paDetails = VarPtr(mxcdb) mxcd.cChannels = 1 If mixerGetControlDetails(hMixer, _ mxcd, _ MIXER_GETCONTROLDETAILSF_VALUE) _ = MMSYSERR_NOERROR Then GetVolumeMute = mxcdb.fValue End If End If End If
mixerClose hMixer End If End Function
Sub SetVolumeMute(Mute As Boolean) Dim hMixer As Long Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim mxc As MIXERCONTROL Dim mxcd As MIXERCONTROLDETAILS Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR Then mxl.cbStruct = Len(mxl) mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
If mixerGetLineInfo(hMixer, _ mxl, _ MIXER_GETLINEINFOF_COMPONENTTYPE) _ = MMSYSERR_NOERROR Then
mixerSetControlDetails hMixer, _ mxcd, _ MIXER_SETCONTROLDETAILSF_VALUE End If End If
mixerClose hMixer End If End Sub
-- Merci, @+, bye, Joe troll75 AROBASE iFrance POINT com ------------------------------------------ Ce message est plein de virus "certifiés" Le_Troll, éleveur de Trolls depuis César, qui disait: Avec une hache, celui qui tient le manche a toujours raison ! ------------------------------------------
le_troll
Mais t'es un véritable génie chercheur, moi je n'avais rien trouvé de si court, extra :o)
-- Merci, @+, bye, Joe troll75 AROBASE iFrance POINT com ------------------------------------------ Ce message est plein de virus "certifiés" Le_Troll, éleveur de Trolls depuis César, qui disait: Avec une hache, celui qui tient le manche a toujours raison ! ------------------------------------------
"Cedric" a écrit dans le message de news:
Bonjour,
Si tu veux regler le volume general de windows sans slider, juste avec un
bouton tu peux utiliser le code suivant (trouvé sur VBfrance.com):
Private Sub Command1_Click() r = Shell("sndvol32 /t") ' Affiche la petite fenêtre volume de windows End Sub
Comme tu peux le constater ce code ne fait pas appel aux API de ton OS. il
utilise seulement Sndvol32 (ce qui permet de regler le volume general du systeme d'exploitation)
Si
"le_troll" a écrit :
> Bonjour chers amis, > > Je cherche comment gérer le volume général, sans bouger le "slider", > juste entrer en saisie une valeur en pourcentage (je parle du volume > général, celui d'en bas à droite de la barre de tâches)... > > Je dois dire que j'ai déjà un truc que François m'avait passé, qui
gère
> le volume et le slider, mais il y en a une telle tartine que je ne
comprend
> absolument rien! En plus j'ai pas de doc, et puis je parle pas trop
anglais,
> désolé, je sais, je ne suis pas normal, je devrais parler l'anglais en > France, et comme ça les chinois vont parler français, lol... > Voici le code, si quelqu'un peut me l'épurer pour juste gérer dans une
FORM
> (une frm, pas un module, lol, étrange manie de faire des fonction à > profusion pour économiser de ridicules variables, et de balancer des tas
de
> trucs dans les modules qui restent en mémoire, [pas de Dudule, les
> volume, sans rien d'autre, juste ça, merci et... heu... bon courage > --form------------------ > vol = Module1.GetVolume > sldVolume.Min = vol.Min > sldVolume.Max = vol.Max > sldVolume.TickFrequency = (vol.Max - vol.Min) / 10 > sldVolume.Value = sldVolume.Max - vol.Volume 'Le max en haut > sldVolume.SmallChange = (vol.Max - vol.Min) / 100 > sldVolume.LargeChange = (vol.Max - vol.Min) / 10 > If Module1.GetVolumeMute Then > chkMute.Value = vbChecked > Else > chkMute.Value = vbUnchecked > End If > Dim hWndToolTip As Long > hWndToolTip = SendMessage(sldVolume.hwnd, TBM_GETTOOLTIPS, 0, ByVal
0&)
> SendMessage hWndToolTip, TTM_ACTIVATE, 0, ByVal 0& > > ----------module---------l'en faut beaucoup pour avoir le volum,
lol ------
> Option Explicit > Private Const MIXER_SETCONTROLDETAILSF_VALUE = &H0& > Private Const MIXER_GETCONTROLDETAILSF_VALUE = &H0& > Private Const MIXER_OBJECTF_MIXER = &H0& > Private Const MMSYSERR_NOERROR = 0 > Private Const MAXPNAMELEN = 32 > Private Const MIXER_LONG_NAME_CHARS = 64 > Private Const MIXER_SHORT_NAME_CHARS = 16 > Private Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3& > Private Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2& > Private Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0& > Private Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000& > > Private Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = _ > (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4) > > Private Const MIXERCONTROL_CT_CLASS_FADER = &H50000000 > Private Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000 > > Private Const MIXERCONTROL_CONTROLTYPE_FADER = _ > (MIXERCONTROL_CT_CLASS_FADER Or _ > MIXERCONTROL_CT_UNITS_UNSIGNED) > > Private Const MIXERCONTROL_CONTROLTYPE_VOLUME = _ > (MIXERCONTROL_CONTROLTYPE_FADER + 1) > > Private Const MIXERCONTROL_CT_CLASS_SWITCH = &H20000000 > Private Const MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = &H0& > Private Const MIXERCONTROL_CT_UNITS_BOOLEAN = &H10000 > > Private Const MIXERCONTROL_CONTROLTYPE_BOOLEAN = _ > (MIXERCONTROL_CT_CLASS_SWITCH Or _ > MIXERCONTROL_CT_SC_SWITCH_BOOLEAN Or _ > MIXERCONTROL_CT_UNITS_BOOLEAN) > > Private Const MIXERCONTROL_CONTROLTYPE_MUTE = _ > (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2) > > > Private Declare Function mixerClose _ > Lib "winmm.dll" ( _ > ByVal hmx As Long _ > ) As Long > > Private Declare Function mixerGetControlDetails _ > Lib "winmm.dll" _ > Alias "mixerGetControlDetailsA" ( _ > ByVal hmxobj As Long, _ > pmxcd As MIXERCONTROLDETAILS, _ > ByVal fdwDetails As Long _ > ) As Long > > Private Declare Function mixerGetLineControls _ > Lib "winmm.dll" _ > Alias "mixerGetLineControlsA" ( _ > ByVal hmxobj As Long, _ > pmxlc As MIXERLINECONTROLS, _ > ByVal fdwControls As Long _ > ) As Long > > Private Declare Function mixerGetLineInfo _ > Lib "winmm.dll" _ > Alias "mixerGetLineInfoA" ( _ > ByVal hmxobj As Long, _ > pmxl As MIXERLINE, _ > ByVal fdwInfo As Long _ > ) As Long > > Private Declare Function mixerOpen _ > Lib "winmm.dll" ( _ > phmx As Long, _ > ByVal uMxId As Long, _ > ByVal dwCallback As Long, _ > ByVal dwInstance As Long, _ > ByVal fdwOpen As Long _ > ) As Long > > Private Declare Function mixerSetControlDetails _ > Lib "winmm.dll" ( _ > ByVal hmxobj As Long, _ > pmxcd As MIXERCONTROLDETAILS, _ > ByVal fdwDetails As Long _ > ) As Long > > Private Type MIXERCAPS > wMid As Integer ' manufacturer id > wPid As Integer ' product id > vDriverVersion As Long ' version of the driver > szPname As String * MAXPNAMELEN ' product name > fdwSupport As Long ' misc. support bits > cDestinations As Long ' count of destinations > End Type > > Type MIXERCONTROL > cbStruct As Long ' size in Byte of MIXERCONTROL > dwControlID As Long ' unique control id for mixer device > dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx > fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx > cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set > szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte ' short name of > control > szName(1 To MIXER_LONG_NAME_CHARS) As Byte ' long name of > control > lMinimum As Long ' Minimum value > lMaximum As Long ' Maximum value > reserved(10) As Long ' reserved structure space > End Type > > Private Type MIXERCONTROLDETAILS > cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS > dwControlID As Long ' control id to get/set details on > cChannels As Long ' number of channels in paDetails array > item As Long ' hwndOwner or cMultipleItems > cbDetails As Long ' size of _one_ details_XX struct > paDetails As Long ' pointer to array of details_XX structs > End Type > > Private Type MIXERCONTROLDETAILS_UNSIGNED > dwValue As Long ' value of the control > End Type > Private Type MIXERCONTROLDETAILS_BOOLEAN > fValue As Long > End Type > > > Private Type MIXERLINE > cbStruct As Long ' size of MIXERLINE structure > dwDestination As Long ' zero based destination index > dwSource As Long ' zero based source index (if
source)
> dwLineID As Long ' unique line id for mixer device > fdwLine As Long ' state/information about line > dwUser As Long ' driver specific information > dwComponentType As Long ' component type line connects to > cChannels As Long ' number of channels line supports > cConnections As Long ' number of connections (possible) > cControls As Long ' number of controls at this line > szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte > szName(1 To MIXER_LONG_NAME_CHARS) As Byte > dwType As Long > dwDeviceID As Long > wMid As Integer > wPid As Integer > vDriverVersion As Long > szPname As String * MAXPNAMELEN > End Type > > Private Type MIXERLINECONTROLS > cbStruct As Long ' size in Byte of MIXERLINECONTROLS > dwLineID As Long ' line id (from MIXERLINE.dwLineID) > ' MIXER_GETLINECONTROLSF_ONEBYID or > dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE > cControls As Long ' count of controls pmxctrl points to > cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL > pamxctrl As Long ' pointer to first MIXERCONTROL array > End Type > > Type myVolume > Min As Long > Max As Long > Volume As Long > End Type > > Function GetVolume() As myVolume > Dim hMixer As Long > Dim mxlc As MIXERLINECONTROLS > Dim mxl As MIXERLINE > Dim mxc As MIXERCONTROL > Dim mxcd As MIXERCONTROLDETAILS > Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED > > If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR > Then > mxl.cbStruct = Len(mxl) > mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS > > If mixerGetLineInfo(hMixer, _ > mxl, _ > MIXER_GETLINEINFOF_COMPONENTTYPE) _ > = MMSYSERR_NOERROR Then > > mxlc.cbStruct = Len(mxlc) > mxlc.dwLineID = mxl.dwLineID > mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME > mxlc.cControls = 1 > mxlc.cbmxctrl = Len(mxc) > mxlc.pamxctrl = VarPtr(mxc) > mxc.cbStruct = Len(mxc) > > If mixerGetLineControls(hMixer, _ > mxlc, _ > MIXER_GETLINECONTROLSF_ONEBYTYPE) _ > = MMSYSERR_NOERROR Then > > GetVolume.Max = mxc.lMaximum > GetVolume.Min = mxc.lMinimum > mxcd.dwControlID = mxc.dwControlID > mxcd.cbStruct = Len(mxcd) > mxcd.item = 0 > mxcd.cbDetails = Len(mxcdu) > mxcd.paDetails = VarPtr(mxcdu) > mxcd.cChannels = 1 > If mixerGetControlDetails(hMixer, _ > mxcd, _ > MIXER_GETCONTROLDETAILSF_VALUE) _ > = MMSYSERR_NOERROR Then > GetVolume.Volume = mxcdu.dwValue > End If > End If > End If > > mixerClose hMixer > End If > End Function > > Sub SetVolume(NewVolume As Long) > Dim hMixer As Long > Dim mxlc As MIXERLINECONTROLS > Dim mxl As MIXERLINE > Dim mxc As MIXERCONTROL > Dim mxcd As MIXERCONTROLDETAILS > Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED > > If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR > Then > mxl.cbStruct = Len(mxl) > mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS > > If mixerGetLineInfo(hMixer, _ > mxl, _ > MIXER_GETLINEINFOF_COMPONENTTYPE) _ > = MMSYSERR_NOERROR Then > > mxlc.cbStruct = Len(mxlc) > mxlc.dwLineID = mxl.dwLineID > mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME > mxlc.cControls = 1 > mxlc.cbmxctrl = Len(mxc) > mxlc.pamxctrl = VarPtr(mxc) > mxc.cbStruct = Len(mxc) > > If mixerGetLineControls(hMixer, _ > mxlc, _ > MIXER_GETLINECONTROLSF_ONEBYTYPE) _ > = MMSYSERR_NOERROR Then > > mxcd.dwControlID = mxc.dwControlID > mxcd.cbStruct = Len(mxcd) > mxcd.item = 0 > mxcd.cbDetails = Len(mxcdu) > mxcd.paDetails = VarPtr(mxcdu) > mxcd.cChannels = 1 > mxcdu.dwValue = NewVolume > > mixerSetControlDetails hMixer, _ > mxcd, _ > MIXER_SETCONTROLDETAILSF_VALUE > End If > End If > > mixerClose hMixer > End If > End Sub > > Function GetVolumeMute() As Boolean > Dim hMixer As Long > Dim mxlc As MIXERLINECONTROLS > Dim mxl As MIXERLINE > Dim mxc As MIXERCONTROL > Dim mxcd As MIXERCONTROLDETAILS > Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN > > If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR > Then > mxl.cbStruct = Len(mxl) > mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS > > If mixerGetLineInfo(hMixer, _ > mxl, _ > MIXER_GETLINEINFOF_COMPONENTTYPE) _ > = MMSYSERR_NOERROR Then > > mxlc.cbStruct = Len(mxlc) > mxlc.dwLineID = mxl.dwLineID > mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_MUTE > mxlc.cControls = 1 > mxlc.cbmxctrl = Len(mxc) > mxlc.pamxctrl = VarPtr(mxc) > mxc.cbStruct = Len(mxc) > > If mixerGetLineControls(hMixer, _ > mxlc, _ > MIXER_GETLINECONTROLSF_ONEBYTYPE) _ > = MMSYSERR_NOERROR Then > > mxcd.dwControlID = mxc.dwControlID > mxcd.cbStruct = Len(mxcd) > mxcd.item = 0 > mxcd.cbDetails = Len(mxcdb) > mxcd.paDetails = VarPtr(mxcdb) > mxcd.cChannels = 1 > If mixerGetControlDetails(hMixer, _ > mxcd, _ > MIXER_GETCONTROLDETAILSF_VALUE) _ > = MMSYSERR_NOERROR Then > GetVolumeMute = mxcdb.fValue > End If > End If > End If > > mixerClose hMixer > End If > End Function > > Sub SetVolumeMute(Mute As Boolean) > Dim hMixer As Long > Dim mxlc As MIXERLINECONTROLS > Dim mxl As MIXERLINE > Dim mxc As MIXERCONTROL > Dim mxcd As MIXERCONTROLDETAILS > Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN > > If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR > Then > mxl.cbStruct = Len(mxl) > mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS > > If mixerGetLineInfo(hMixer, _ > mxl, _ > MIXER_GETLINEINFOF_COMPONENTTYPE) _ > = MMSYSERR_NOERROR Then > > mxlc.cbStruct = Len(mxlc) > mxlc.dwLineID = mxl.dwLineID > mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_MUTE > mxlc.cControls = 1 > mxlc.cbmxctrl = Len(mxc) > mxlc.pamxctrl = VarPtr(mxc) > mxc.cbStruct = Len(mxc) > > If mixerGetLineControls(hMixer, _ > mxlc, _ > MIXER_GETLINECONTROLSF_ONEBYTYPE) _ > = MMSYSERR_NOERROR Then > > mxcd.dwControlID = mxc.dwControlID > mxcd.cbStruct = Len(mxcd) > mxcd.item = 0 > mxcd.cbDetails = Len(mxcdb) > mxcd.paDetails = VarPtr(mxcdb) > mxcd.cChannels = 1 > mxcdb.fValue = Mute > > mixerSetControlDetails hMixer, _ > mxcd, _ > MIXER_SETCONTROLDETAILSF_VALUE > End If > End If > > mixerClose hMixer > End If > End Sub > > > -- > Merci, @+, bye, Joe > troll75 AROBASE iFrance POINT com > ------------------------------------------ > Ce message est plein de virus "certifiés" > Le_Troll, éleveur de Trolls depuis César, qui disait: > Avec une hache, celui qui tient le manche a toujours raison ! > ------------------------------------------ > > > > >
Mais t'es un véritable génie chercheur, moi je n'avais rien trouvé de si
court, extra :o)
--
Merci, @+, bye, Joe
troll75 AROBASE iFrance POINT com
------------------------------------------
Ce message est plein de virus "certifiés"
Le_Troll, éleveur de Trolls depuis César, qui disait:
Avec une hache, celui qui tient le manche a toujours raison !
------------------------------------------
"Cedric" <Cedric@discussions.microsoft.com> a écrit dans le message de news:
5547FFBF-3E6D-4576-BC9A-2DD45E15D01E@microsoft.com...
Bonjour,
Si tu veux regler le volume general de windows sans slider, juste avec un
bouton tu peux utiliser le code suivant (trouvé sur VBfrance.com):
Private Sub Command1_Click()
r = Shell("sndvol32 /t") ' Affiche la petite fenêtre volume de windows
End Sub
Comme tu peux le constater ce code ne fait pas appel aux API de ton OS. il
utilise seulement Sndvol32 (ce qui permet de regler le volume general du
systeme d'exploitation)
Si
"le_troll" a écrit :
> Bonjour chers amis,
>
> Je cherche comment gérer le volume général, sans bouger le "slider",
> juste entrer en saisie une valeur en pourcentage (je parle du volume
> général, celui d'en bas à droite de la barre de tâches)...
>
> Je dois dire que j'ai déjà un truc que François m'avait passé, qui
gère
> le volume et le slider, mais il y en a une telle tartine que je ne
comprend
> absolument rien! En plus j'ai pas de doc, et puis je parle pas trop
anglais,
> désolé, je sais, je ne suis pas normal, je devrais parler l'anglais en
> France, et comme ça les chinois vont parler français, lol...
> Voici le code, si quelqu'un peut me l'épurer pour juste gérer dans une
FORM
> (une frm, pas un module, lol, étrange manie de faire des fonction à
> profusion pour économiser de ridicules variables, et de balancer des tas
de
> trucs dans les modules qui restent en mémoire, [pas de Dudule, les
> volume, sans rien d'autre, juste ça, merci et... heu... bon courage
> --form------------------
> vol = Module1.GetVolume
> sldVolume.Min = vol.Min
> sldVolume.Max = vol.Max
> sldVolume.TickFrequency = (vol.Max - vol.Min) / 10
> sldVolume.Value = sldVolume.Max - vol.Volume 'Le max en haut
> sldVolume.SmallChange = (vol.Max - vol.Min) / 100
> sldVolume.LargeChange = (vol.Max - vol.Min) / 10
> If Module1.GetVolumeMute Then
> chkMute.Value = vbChecked
> Else
> chkMute.Value = vbUnchecked
> End If
> Dim hWndToolTip As Long
> hWndToolTip = SendMessage(sldVolume.hwnd, TBM_GETTOOLTIPS, 0, ByVal
0&)
> SendMessage hWndToolTip, TTM_ACTIVATE, 0, ByVal 0&
>
> ----------module---------l'en faut beaucoup pour avoir le volum,
lol ------
> Option Explicit
> Private Const MIXER_SETCONTROLDETAILSF_VALUE = &H0&
> Private Const MIXER_GETCONTROLDETAILSF_VALUE = &H0&
> Private Const MIXER_OBJECTF_MIXER = &H0&
> Private Const MMSYSERR_NOERROR = 0
> Private Const MAXPNAMELEN = 32
> Private Const MIXER_LONG_NAME_CHARS = 64
> Private Const MIXER_SHORT_NAME_CHARS = 16
> Private Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3&
> Private Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2&
> Private Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0&
> Private Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000&
>
> Private Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = _
> (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
>
> Private Const MIXERCONTROL_CT_CLASS_FADER = &H50000000
> Private Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000
>
> Private Const MIXERCONTROL_CONTROLTYPE_FADER = _
> (MIXERCONTROL_CT_CLASS_FADER Or _
> MIXERCONTROL_CT_UNITS_UNSIGNED)
>
> Private Const MIXERCONTROL_CONTROLTYPE_VOLUME = _
> (MIXERCONTROL_CONTROLTYPE_FADER + 1)
>
> Private Const MIXERCONTROL_CT_CLASS_SWITCH = &H20000000
> Private Const MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = &H0&
> Private Const MIXERCONTROL_CT_UNITS_BOOLEAN = &H10000
>
> Private Const MIXERCONTROL_CONTROLTYPE_BOOLEAN = _
> (MIXERCONTROL_CT_CLASS_SWITCH Or _
> MIXERCONTROL_CT_SC_SWITCH_BOOLEAN Or _
> MIXERCONTROL_CT_UNITS_BOOLEAN)
>
> Private Const MIXERCONTROL_CONTROLTYPE_MUTE = _
> (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
>
>
> Private Declare Function mixerClose _
> Lib "winmm.dll" ( _
> ByVal hmx As Long _
> ) As Long
>
> Private Declare Function mixerGetControlDetails _
> Lib "winmm.dll" _
> Alias "mixerGetControlDetailsA" ( _
> ByVal hmxobj As Long, _
> pmxcd As MIXERCONTROLDETAILS, _
> ByVal fdwDetails As Long _
> ) As Long
>
> Private Declare Function mixerGetLineControls _
> Lib "winmm.dll" _
> Alias "mixerGetLineControlsA" ( _
> ByVal hmxobj As Long, _
> pmxlc As MIXERLINECONTROLS, _
> ByVal fdwControls As Long _
> ) As Long
>
> Private Declare Function mixerGetLineInfo _
> Lib "winmm.dll" _
> Alias "mixerGetLineInfoA" ( _
> ByVal hmxobj As Long, _
> pmxl As MIXERLINE, _
> ByVal fdwInfo As Long _
> ) As Long
>
> Private Declare Function mixerOpen _
> Lib "winmm.dll" ( _
> phmx As Long, _
> ByVal uMxId As Long, _
> ByVal dwCallback As Long, _
> ByVal dwInstance As Long, _
> ByVal fdwOpen As Long _
> ) As Long
>
> Private Declare Function mixerSetControlDetails _
> Lib "winmm.dll" ( _
> ByVal hmxobj As Long, _
> pmxcd As MIXERCONTROLDETAILS, _
> ByVal fdwDetails As Long _
> ) As Long
>
> Private Type MIXERCAPS
> wMid As Integer ' manufacturer id
> wPid As Integer ' product id
> vDriverVersion As Long ' version of the driver
> szPname As String * MAXPNAMELEN ' product name
> fdwSupport As Long ' misc. support bits
> cDestinations As Long ' count of destinations
> End Type
>
> Type MIXERCONTROL
> cbStruct As Long ' size in Byte of MIXERCONTROL
> dwControlID As Long ' unique control id for mixer device
> dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx
> fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
> cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set
> szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte ' short name of
> control
> szName(1 To MIXER_LONG_NAME_CHARS) As Byte ' long name of
> control
> lMinimum As Long ' Minimum value
> lMaximum As Long ' Maximum value
> reserved(10) As Long ' reserved structure space
> End Type
>
> Private Type MIXERCONTROLDETAILS
> cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
> dwControlID As Long ' control id to get/set details on
> cChannels As Long ' number of channels in paDetails array
> item As Long ' hwndOwner or cMultipleItems
> cbDetails As Long ' size of _one_ details_XX struct
> paDetails As Long ' pointer to array of details_XX structs
> End Type
>
> Private Type MIXERCONTROLDETAILS_UNSIGNED
> dwValue As Long ' value of the control
> End Type
> Private Type MIXERCONTROLDETAILS_BOOLEAN
> fValue As Long
> End Type
>
>
> Private Type MIXERLINE
> cbStruct As Long ' size of MIXERLINE structure
> dwDestination As Long ' zero based destination index
> dwSource As Long ' zero based source index (if
source)
> dwLineID As Long ' unique line id for mixer device
> fdwLine As Long ' state/information about line
> dwUser As Long ' driver specific information
> dwComponentType As Long ' component type line connects to
> cChannels As Long ' number of channels line supports
> cConnections As Long ' number of connections (possible)
> cControls As Long ' number of controls at this line
> szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte
> szName(1 To MIXER_LONG_NAME_CHARS) As Byte
> dwType As Long
> dwDeviceID As Long
> wMid As Integer
> wPid As Integer
> vDriverVersion As Long
> szPname As String * MAXPNAMELEN
> End Type
>
> Private Type MIXERLINECONTROLS
> cbStruct As Long ' size in Byte of MIXERLINECONTROLS
> dwLineID As Long ' line id (from MIXERLINE.dwLineID)
> ' MIXER_GETLINECONTROLSF_ONEBYID or
> dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE
> cControls As Long ' count of controls pmxctrl points to
> cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
> pamxctrl As Long ' pointer to first MIXERCONTROL array
> End Type
>
> Type myVolume
> Min As Long
> Max As Long
> Volume As Long
> End Type
>
> Function GetVolume() As myVolume
> Dim hMixer As Long
> Dim mxlc As MIXERLINECONTROLS
> Dim mxl As MIXERLINE
> Dim mxc As MIXERCONTROL
> Dim mxcd As MIXERCONTROLDETAILS
> Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
>
> If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR
> Then
> mxl.cbStruct = Len(mxl)
> mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
>
> If mixerGetLineInfo(hMixer, _
> mxl, _
> MIXER_GETLINEINFOF_COMPONENTTYPE) _
> = MMSYSERR_NOERROR Then
>
> mxlc.cbStruct = Len(mxlc)
> mxlc.dwLineID = mxl.dwLineID
> mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
> mxlc.cControls = 1
> mxlc.cbmxctrl = Len(mxc)
> mxlc.pamxctrl = VarPtr(mxc)
> mxc.cbStruct = Len(mxc)
>
> If mixerGetLineControls(hMixer, _
> mxlc, _
> MIXER_GETLINECONTROLSF_ONEBYTYPE) _
> = MMSYSERR_NOERROR Then
>
> GetVolume.Max = mxc.lMaximum
> GetVolume.Min = mxc.lMinimum
> mxcd.dwControlID = mxc.dwControlID
> mxcd.cbStruct = Len(mxcd)
> mxcd.item = 0
> mxcd.cbDetails = Len(mxcdu)
> mxcd.paDetails = VarPtr(mxcdu)
> mxcd.cChannels = 1
> If mixerGetControlDetails(hMixer, _
> mxcd, _
> MIXER_GETCONTROLDETAILSF_VALUE) _
> = MMSYSERR_NOERROR Then
> GetVolume.Volume = mxcdu.dwValue
> End If
> End If
> End If
>
> mixerClose hMixer
> End If
> End Function
>
> Sub SetVolume(NewVolume As Long)
> Dim hMixer As Long
> Dim mxlc As MIXERLINECONTROLS
> Dim mxl As MIXERLINE
> Dim mxc As MIXERCONTROL
> Dim mxcd As MIXERCONTROLDETAILS
> Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED
>
> If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR
> Then
> mxl.cbStruct = Len(mxl)
> mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
>
> If mixerGetLineInfo(hMixer, _
> mxl, _
> MIXER_GETLINEINFOF_COMPONENTTYPE) _
> = MMSYSERR_NOERROR Then
>
> mxlc.cbStruct = Len(mxlc)
> mxlc.dwLineID = mxl.dwLineID
> mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME
> mxlc.cControls = 1
> mxlc.cbmxctrl = Len(mxc)
> mxlc.pamxctrl = VarPtr(mxc)
> mxc.cbStruct = Len(mxc)
>
> If mixerGetLineControls(hMixer, _
> mxlc, _
> MIXER_GETLINECONTROLSF_ONEBYTYPE) _
> = MMSYSERR_NOERROR Then
>
> mxcd.dwControlID = mxc.dwControlID
> mxcd.cbStruct = Len(mxcd)
> mxcd.item = 0
> mxcd.cbDetails = Len(mxcdu)
> mxcd.paDetails = VarPtr(mxcdu)
> mxcd.cChannels = 1
> mxcdu.dwValue = NewVolume
>
> mixerSetControlDetails hMixer, _
> mxcd, _
> MIXER_SETCONTROLDETAILSF_VALUE
> End If
> End If
>
> mixerClose hMixer
> End If
> End Sub
>
> Function GetVolumeMute() As Boolean
> Dim hMixer As Long
> Dim mxlc As MIXERLINECONTROLS
> Dim mxl As MIXERLINE
> Dim mxc As MIXERCONTROL
> Dim mxcd As MIXERCONTROLDETAILS
> Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
>
> If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR
> Then
> mxl.cbStruct = Len(mxl)
> mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
>
> If mixerGetLineInfo(hMixer, _
> mxl, _
> MIXER_GETLINEINFOF_COMPONENTTYPE) _
> = MMSYSERR_NOERROR Then
>
> mxlc.cbStruct = Len(mxlc)
> mxlc.dwLineID = mxl.dwLineID
> mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_MUTE
> mxlc.cControls = 1
> mxlc.cbmxctrl = Len(mxc)
> mxlc.pamxctrl = VarPtr(mxc)
> mxc.cbStruct = Len(mxc)
>
> If mixerGetLineControls(hMixer, _
> mxlc, _
> MIXER_GETLINECONTROLSF_ONEBYTYPE) _
> = MMSYSERR_NOERROR Then
>
> mxcd.dwControlID = mxc.dwControlID
> mxcd.cbStruct = Len(mxcd)
> mxcd.item = 0
> mxcd.cbDetails = Len(mxcdb)
> mxcd.paDetails = VarPtr(mxcdb)
> mxcd.cChannels = 1
> If mixerGetControlDetails(hMixer, _
> mxcd, _
> MIXER_GETCONTROLDETAILSF_VALUE) _
> = MMSYSERR_NOERROR Then
> GetVolumeMute = mxcdb.fValue
> End If
> End If
> End If
>
> mixerClose hMixer
> End If
> End Function
>
> Sub SetVolumeMute(Mute As Boolean)
> Dim hMixer As Long
> Dim mxlc As MIXERLINECONTROLS
> Dim mxl As MIXERLINE
> Dim mxc As MIXERCONTROL
> Dim mxcd As MIXERCONTROLDETAILS
> Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN
>
> If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR
> Then
> mxl.cbStruct = Len(mxl)
> mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
>
> If mixerGetLineInfo(hMixer, _
> mxl, _
> MIXER_GETLINEINFOF_COMPONENTTYPE) _
> = MMSYSERR_NOERROR Then
>
> mxlc.cbStruct = Len(mxlc)
> mxlc.dwLineID = mxl.dwLineID
> mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_MUTE
> mxlc.cControls = 1
> mxlc.cbmxctrl = Len(mxc)
> mxlc.pamxctrl = VarPtr(mxc)
> mxc.cbStruct = Len(mxc)
>
> If mixerGetLineControls(hMixer, _
> mxlc, _
> MIXER_GETLINECONTROLSF_ONEBYTYPE) _
> = MMSYSERR_NOERROR Then
>
> mxcd.dwControlID = mxc.dwControlID
> mxcd.cbStruct = Len(mxcd)
> mxcd.item = 0
> mxcd.cbDetails = Len(mxcdb)
> mxcd.paDetails = VarPtr(mxcdb)
> mxcd.cChannels = 1
> mxcdb.fValue = Mute
>
> mixerSetControlDetails hMixer, _
> mxcd, _
> MIXER_SETCONTROLDETAILSF_VALUE
> End If
> End If
>
> mixerClose hMixer
> End If
> End Sub
>
>
> --
> Merci, @+, bye, Joe
> troll75 AROBASE iFrance POINT com
> ------------------------------------------
> Ce message est plein de virus "certifiés"
> Le_Troll, éleveur de Trolls depuis César, qui disait:
> Avec une hache, celui qui tient le manche a toujours raison !
> ------------------------------------------
>
>
>
>
>
Mais t'es un véritable génie chercheur, moi je n'avais rien trouvé de si court, extra :o)
-- Merci, @+, bye, Joe troll75 AROBASE iFrance POINT com ------------------------------------------ Ce message est plein de virus "certifiés" Le_Troll, éleveur de Trolls depuis César, qui disait: Avec une hache, celui qui tient le manche a toujours raison ! ------------------------------------------
"Cedric" a écrit dans le message de news:
Bonjour,
Si tu veux regler le volume general de windows sans slider, juste avec un
bouton tu peux utiliser le code suivant (trouvé sur VBfrance.com):
Private Sub Command1_Click() r = Shell("sndvol32 /t") ' Affiche la petite fenêtre volume de windows End Sub
Comme tu peux le constater ce code ne fait pas appel aux API de ton OS. il
utilise seulement Sndvol32 (ce qui permet de regler le volume general du systeme d'exploitation)
Si
"le_troll" a écrit :
> Bonjour chers amis, > > Je cherche comment gérer le volume général, sans bouger le "slider", > juste entrer en saisie une valeur en pourcentage (je parle du volume > général, celui d'en bas à droite de la barre de tâches)... > > Je dois dire que j'ai déjà un truc que François m'avait passé, qui
gère
> le volume et le slider, mais il y en a une telle tartine que je ne
comprend
> absolument rien! En plus j'ai pas de doc, et puis je parle pas trop
anglais,
> désolé, je sais, je ne suis pas normal, je devrais parler l'anglais en > France, et comme ça les chinois vont parler français, lol... > Voici le code, si quelqu'un peut me l'épurer pour juste gérer dans une
FORM
> (une frm, pas un module, lol, étrange manie de faire des fonction à > profusion pour économiser de ridicules variables, et de balancer des tas
de
> trucs dans les modules qui restent en mémoire, [pas de Dudule, les
> volume, sans rien d'autre, juste ça, merci et... heu... bon courage > --form------------------ > vol = Module1.GetVolume > sldVolume.Min = vol.Min > sldVolume.Max = vol.Max > sldVolume.TickFrequency = (vol.Max - vol.Min) / 10 > sldVolume.Value = sldVolume.Max - vol.Volume 'Le max en haut > sldVolume.SmallChange = (vol.Max - vol.Min) / 100 > sldVolume.LargeChange = (vol.Max - vol.Min) / 10 > If Module1.GetVolumeMute Then > chkMute.Value = vbChecked > Else > chkMute.Value = vbUnchecked > End If > Dim hWndToolTip As Long > hWndToolTip = SendMessage(sldVolume.hwnd, TBM_GETTOOLTIPS, 0, ByVal
0&)
> SendMessage hWndToolTip, TTM_ACTIVATE, 0, ByVal 0& > > ----------module---------l'en faut beaucoup pour avoir le volum,
lol ------
> Option Explicit > Private Const MIXER_SETCONTROLDETAILSF_VALUE = &H0& > Private Const MIXER_GETCONTROLDETAILSF_VALUE = &H0& > Private Const MIXER_OBJECTF_MIXER = &H0& > Private Const MMSYSERR_NOERROR = 0 > Private Const MAXPNAMELEN = 32 > Private Const MIXER_LONG_NAME_CHARS = 64 > Private Const MIXER_SHORT_NAME_CHARS = 16 > Private Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3& > Private Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2& > Private Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0& > Private Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000& > > Private Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = _ > (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4) > > Private Const MIXERCONTROL_CT_CLASS_FADER = &H50000000 > Private Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000 > > Private Const MIXERCONTROL_CONTROLTYPE_FADER = _ > (MIXERCONTROL_CT_CLASS_FADER Or _ > MIXERCONTROL_CT_UNITS_UNSIGNED) > > Private Const MIXERCONTROL_CONTROLTYPE_VOLUME = _ > (MIXERCONTROL_CONTROLTYPE_FADER + 1) > > Private Const MIXERCONTROL_CT_CLASS_SWITCH = &H20000000 > Private Const MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = &H0& > Private Const MIXERCONTROL_CT_UNITS_BOOLEAN = &H10000 > > Private Const MIXERCONTROL_CONTROLTYPE_BOOLEAN = _ > (MIXERCONTROL_CT_CLASS_SWITCH Or _ > MIXERCONTROL_CT_SC_SWITCH_BOOLEAN Or _ > MIXERCONTROL_CT_UNITS_BOOLEAN) > > Private Const MIXERCONTROL_CONTROLTYPE_MUTE = _ > (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2) > > > Private Declare Function mixerClose _ > Lib "winmm.dll" ( _ > ByVal hmx As Long _ > ) As Long > > Private Declare Function mixerGetControlDetails _ > Lib "winmm.dll" _ > Alias "mixerGetControlDetailsA" ( _ > ByVal hmxobj As Long, _ > pmxcd As MIXERCONTROLDETAILS, _ > ByVal fdwDetails As Long _ > ) As Long > > Private Declare Function mixerGetLineControls _ > Lib "winmm.dll" _ > Alias "mixerGetLineControlsA" ( _ > ByVal hmxobj As Long, _ > pmxlc As MIXERLINECONTROLS, _ > ByVal fdwControls As Long _ > ) As Long > > Private Declare Function mixerGetLineInfo _ > Lib "winmm.dll" _ > Alias "mixerGetLineInfoA" ( _ > ByVal hmxobj As Long, _ > pmxl As MIXERLINE, _ > ByVal fdwInfo As Long _ > ) As Long > > Private Declare Function mixerOpen _ > Lib "winmm.dll" ( _ > phmx As Long, _ > ByVal uMxId As Long, _ > ByVal dwCallback As Long, _ > ByVal dwInstance As Long, _ > ByVal fdwOpen As Long _ > ) As Long > > Private Declare Function mixerSetControlDetails _ > Lib "winmm.dll" ( _ > ByVal hmxobj As Long, _ > pmxcd As MIXERCONTROLDETAILS, _ > ByVal fdwDetails As Long _ > ) As Long > > Private Type MIXERCAPS > wMid As Integer ' manufacturer id > wPid As Integer ' product id > vDriverVersion As Long ' version of the driver > szPname As String * MAXPNAMELEN ' product name > fdwSupport As Long ' misc. support bits > cDestinations As Long ' count of destinations > End Type > > Type MIXERCONTROL > cbStruct As Long ' size in Byte of MIXERCONTROL > dwControlID As Long ' unique control id for mixer device > dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_xxx > fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx > cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULTIPLE set > szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte ' short name of > control > szName(1 To MIXER_LONG_NAME_CHARS) As Byte ' long name of > control > lMinimum As Long ' Minimum value > lMaximum As Long ' Maximum value > reserved(10) As Long ' reserved structure space > End Type > > Private Type MIXERCONTROLDETAILS > cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS > dwControlID As Long ' control id to get/set details on > cChannels As Long ' number of channels in paDetails array > item As Long ' hwndOwner or cMultipleItems > cbDetails As Long ' size of _one_ details_XX struct > paDetails As Long ' pointer to array of details_XX structs > End Type > > Private Type MIXERCONTROLDETAILS_UNSIGNED > dwValue As Long ' value of the control > End Type > Private Type MIXERCONTROLDETAILS_BOOLEAN > fValue As Long > End Type > > > Private Type MIXERLINE > cbStruct As Long ' size of MIXERLINE structure > dwDestination As Long ' zero based destination index > dwSource As Long ' zero based source index (if
source)
> dwLineID As Long ' unique line id for mixer device > fdwLine As Long ' state/information about line > dwUser As Long ' driver specific information > dwComponentType As Long ' component type line connects to > cChannels As Long ' number of channels line supports > cConnections As Long ' number of connections (possible) > cControls As Long ' number of controls at this line > szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte > szName(1 To MIXER_LONG_NAME_CHARS) As Byte > dwType As Long > dwDeviceID As Long > wMid As Integer > wPid As Integer > vDriverVersion As Long > szPname As String * MAXPNAMELEN > End Type > > Private Type MIXERLINECONTROLS > cbStruct As Long ' size in Byte of MIXERLINECONTROLS > dwLineID As Long ' line id (from MIXERLINE.dwLineID) > ' MIXER_GETLINECONTROLSF_ONEBYID or > dwControl As Long ' MIXER_GETLINECONTROLSF_ONEBYTYPE > cControls As Long ' count of controls pmxctrl points to > cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL > pamxctrl As Long ' pointer to first MIXERCONTROL array > End Type > > Type myVolume > Min As Long > Max As Long > Volume As Long > End Type > > Function GetVolume() As myVolume > Dim hMixer As Long > Dim mxlc As MIXERLINECONTROLS > Dim mxl As MIXERLINE > Dim mxc As MIXERCONTROL > Dim mxcd As MIXERCONTROLDETAILS > Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED > > If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR > Then > mxl.cbStruct = Len(mxl) > mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS > > If mixerGetLineInfo(hMixer, _ > mxl, _ > MIXER_GETLINEINFOF_COMPONENTTYPE) _ > = MMSYSERR_NOERROR Then > > mxlc.cbStruct = Len(mxlc) > mxlc.dwLineID = mxl.dwLineID > mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME > mxlc.cControls = 1 > mxlc.cbmxctrl = Len(mxc) > mxlc.pamxctrl = VarPtr(mxc) > mxc.cbStruct = Len(mxc) > > If mixerGetLineControls(hMixer, _ > mxlc, _ > MIXER_GETLINECONTROLSF_ONEBYTYPE) _ > = MMSYSERR_NOERROR Then > > GetVolume.Max = mxc.lMaximum > GetVolume.Min = mxc.lMinimum > mxcd.dwControlID = mxc.dwControlID > mxcd.cbStruct = Len(mxcd) > mxcd.item = 0 > mxcd.cbDetails = Len(mxcdu) > mxcd.paDetails = VarPtr(mxcdu) > mxcd.cChannels = 1 > If mixerGetControlDetails(hMixer, _ > mxcd, _ > MIXER_GETCONTROLDETAILSF_VALUE) _ > = MMSYSERR_NOERROR Then > GetVolume.Volume = mxcdu.dwValue > End If > End If > End If > > mixerClose hMixer > End If > End Function > > Sub SetVolume(NewVolume As Long) > Dim hMixer As Long > Dim mxlc As MIXERLINECONTROLS > Dim mxl As MIXERLINE > Dim mxc As MIXERCONTROL > Dim mxcd As MIXERCONTROLDETAILS > Dim mxcdu As MIXERCONTROLDETAILS_UNSIGNED > > If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR > Then > mxl.cbStruct = Len(mxl) > mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS > > If mixerGetLineInfo(hMixer, _ > mxl, _ > MIXER_GETLINEINFOF_COMPONENTTYPE) _ > = MMSYSERR_NOERROR Then > > mxlc.cbStruct = Len(mxlc) > mxlc.dwLineID = mxl.dwLineID > mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_VOLUME > mxlc.cControls = 1 > mxlc.cbmxctrl = Len(mxc) > mxlc.pamxctrl = VarPtr(mxc) > mxc.cbStruct = Len(mxc) > > If mixerGetLineControls(hMixer, _ > mxlc, _ > MIXER_GETLINECONTROLSF_ONEBYTYPE) _ > = MMSYSERR_NOERROR Then > > mxcd.dwControlID = mxc.dwControlID > mxcd.cbStruct = Len(mxcd) > mxcd.item = 0 > mxcd.cbDetails = Len(mxcdu) > mxcd.paDetails = VarPtr(mxcdu) > mxcd.cChannels = 1 > mxcdu.dwValue = NewVolume > > mixerSetControlDetails hMixer, _ > mxcd, _ > MIXER_SETCONTROLDETAILSF_VALUE > End If > End If > > mixerClose hMixer > End If > End Sub > > Function GetVolumeMute() As Boolean > Dim hMixer As Long > Dim mxlc As MIXERLINECONTROLS > Dim mxl As MIXERLINE > Dim mxc As MIXERCONTROL > Dim mxcd As MIXERCONTROLDETAILS > Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN > > If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR > Then > mxl.cbStruct = Len(mxl) > mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS > > If mixerGetLineInfo(hMixer, _ > mxl, _ > MIXER_GETLINEINFOF_COMPONENTTYPE) _ > = MMSYSERR_NOERROR Then > > mxlc.cbStruct = Len(mxlc) > mxlc.dwLineID = mxl.dwLineID > mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_MUTE > mxlc.cControls = 1 > mxlc.cbmxctrl = Len(mxc) > mxlc.pamxctrl = VarPtr(mxc) > mxc.cbStruct = Len(mxc) > > If mixerGetLineControls(hMixer, _ > mxlc, _ > MIXER_GETLINECONTROLSF_ONEBYTYPE) _ > = MMSYSERR_NOERROR Then > > mxcd.dwControlID = mxc.dwControlID > mxcd.cbStruct = Len(mxcd) > mxcd.item = 0 > mxcd.cbDetails = Len(mxcdb) > mxcd.paDetails = VarPtr(mxcdb) > mxcd.cChannels = 1 > If mixerGetControlDetails(hMixer, _ > mxcd, _ > MIXER_GETCONTROLDETAILSF_VALUE) _ > = MMSYSERR_NOERROR Then > GetVolumeMute = mxcdb.fValue > End If > End If > End If > > mixerClose hMixer > End If > End Function > > Sub SetVolumeMute(Mute As Boolean) > Dim hMixer As Long > Dim mxlc As MIXERLINECONTROLS > Dim mxl As MIXERLINE > Dim mxc As MIXERCONTROL > Dim mxcd As MIXERCONTROLDETAILS > Dim mxcdb As MIXERCONTROLDETAILS_BOOLEAN > > If mixerOpen(hMixer, 0, 0, 0, MIXER_OBJECTF_MIXER) MMSYSERR_NOERROR > Then > mxl.cbStruct = Len(mxl) > mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS > > If mixerGetLineInfo(hMixer, _ > mxl, _ > MIXER_GETLINEINFOF_COMPONENTTYPE) _ > = MMSYSERR_NOERROR Then > > mxlc.cbStruct = Len(mxlc) > mxlc.dwLineID = mxl.dwLineID > mxlc.dwControl = MIXERCONTROL_CONTROLTYPE_MUTE > mxlc.cControls = 1 > mxlc.cbmxctrl = Len(mxc) > mxlc.pamxctrl = VarPtr(mxc) > mxc.cbStruct = Len(mxc) > > If mixerGetLineControls(hMixer, _ > mxlc, _ > MIXER_GETLINECONTROLSF_ONEBYTYPE) _ > = MMSYSERR_NOERROR Then > > mxcd.dwControlID = mxc.dwControlID > mxcd.cbStruct = Len(mxcd) > mxcd.item = 0 > mxcd.cbDetails = Len(mxcdb) > mxcd.paDetails = VarPtr(mxcdb) > mxcd.cChannels = 1 > mxcdb.fValue = Mute > > mixerSetControlDetails hMixer, _ > mxcd, _ > MIXER_SETCONTROLDETAILSF_VALUE > End If > End If > > mixerClose hMixer > End If > End Sub > > > -- > Merci, @+, bye, Joe > troll75 AROBASE iFrance POINT com > ------------------------------------------ > Ce message est plein de virus "certifiés" > Le_Troll, éleveur de Trolls depuis César, qui disait: > Avec une hache, celui qui tient le manche a toujours raison ! > ------------------------------------------ > > > > >