Newsgroup: it.comp.lang.visual-basic
Titolo: Controllo Volume

Ciao.
    Qualcuno saprebbe indicarmi come gestire il controllo del volume
all'interno di una applicazione sviluppata con vb4 o vb5????
Grazie anticipate.
Giuseppe



Io ho un OCX che ho scaricato da 
www.download.com
usi il motore interno e
cerchi ocx
nell'ultima pagina c'è il riferimento al controllo
prova
aldo



L'avevo memorizzata da qualche parte ma non  l'ho provata vedi tu poi fammi
sapere,c'e' da perderci un po' di tempo ma ti da' l'idea su e come
muoverti....
Dim q As String, ahgt, ghtr As String
Dim id As Long, v As Long, i As Long, lVol As lVolType, Vol As VolType, lv
As Double, rv As Double
Private Declare Function auxGetVolume Lib "WINMM.DLL" (ByVal uDeviceID As
Long, lpdwVolume As Long) As Long
Private Declare Function mciGetDeviceID Lib "WINMM.DLL" Alias
"mciGetDeviceIDA" (ByVal lpstrName As String) As Long
Private Declare Function waveOutGetVolume Lib "WINMM.DLL" (ByVal uDeviceID
As Long, lpdwVolume As Long) As Long
Private Declare Function waveOutSetVolume Lib "WINMM.DLL" (ByVal uDeviceID
As Long, ByVal dwVolume As Long) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long
Private Type lVolType
       v As Long
End Type
Private Type VolType
       lv As Integer
       rv As Integer
End Type
Sub Findout()
       id = -0
       i = waveOutGetVolume(id, v)
       lVol.v = v
       LSet Vol = lVol
       lv = Vol.lv: rv = Vol.rv
       lv = lv - &HFFF
       rv = rv - &HFFF
              If lv < -32768 Then lv = 65535 + lv
                            If rv < -32768 Then rv = 65535 + rv
                                   Vol.lv = lv
                                   Vol.rv = rv
                                   LSet lVol = Vol
                                   v = lVol.v
                                   ghtr = Left(lv, 1)
                                          If ghtr = "-" Then
                                                 GoTo erre
                                          End If
                                          If lv < 5000 Then
                                                 q = 1
                                                 GoTo sayit
                                          End If
                                          If lv < 10000 Then
                                                 q = 2
                                                 GoTo sayit
                                          End If
                                          If lv < 15000 Then
                                                 q = 3
                                                 GoTo sayit
                                          End If
                                          If lv < 20000 Then
                                                 q = 4
                                                 GoTo sayit
                                          End If
                                          If lv < 25000 Then
                                                 q = 5
                                                 GoTo sayit
                                          End If
                                          If lv < 30000 Then
                                                 q = 6
                                                 GoTo sayit
                                          End If
                                   erre:
                                          If lv < (-28000) Then
                                                 q = 7
                                                 GoTo sayit
                                          End If
                                          If lv < (-22000) Then
                                                 q = 8
                                                 GoTo sayit
                                          End If
                                          If lv < (-15000) Then
                                                 q = 9
                                                 GoTo sayit
                                          End If
                                          If lv < (-8000) Then
                                                 q = 10
                                                 GoTo sayit
                                          End If
                                   sayit:
                                   ProgressBar1.Value = q
                            End Sub
Private Sub Command1_Click()
              If q = "1" Then
                     Exit Sub
              End If
       id = -0
       i = waveOutGetVolume(id, v)
       lVol.v = v
       LSet Vol = lVol
       lv = Vol.lv: rv = Vol.rv
       lv = lv - &HFFF
       rv = rv - &HFFF
              If lv < -32768 Then lv = 65535 + lv
                            If rv < -32768 Then rv = 65535 + rv
                                   Vol.lv = lv
                                   Vol.rv = rv
                                   LSet lVol = Vol
                                   v = lVol.v
                                   i = waveOutSetVolume(id, v)
                                   Call Findout
                            End Sub
Private Sub Command2_Click()
              If q = "10" Then
                     Exit Sub
              End If
       Dim dfre
       j = 1
       id = -0
       i = waveOutGetVolume(id, v)
       lVol.v = v
       LSet Vol = lVol
       lv = Vol.lv: rv = Vol.rv
       lv = lv + &HFFF
       rv = rv + &HFFF
       '     'If lv <= -30000 Then Exit Sub
              If lv > 32767 Then lv = lv - 65536
                            If rv > 32767 Then rv = rv - 65536
                                   Vol.lv = lv
                                   Vol.rv = rv
                                   LSet lVol = Vol
                                   v = lVol.v
                                   i = waveOutSetVolume(id, v)
                                   Call Findout
                            End Sub
Private Sub Form_Load()
       Call Findout
End Sub