Formular una preguntaFormular una pregunta
 

RespondidaSystem Volume Control

  • miércoles, 04 de noviembre de 2009 22:34Darkhalodude Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    caN SOMONE guide me how to make my own system sound control in vb.net like a slider or % or anything!!! just a volume control!
    anyone?
    I like..... Understandable Answers 1 2 3 4 5 - - - - - Rate yourself And Have A Kitkat 5 5 5 5 5

Respuestas

  • jueves, 05 de noviembre de 2009 1:52kaymaf Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     RespondidaTiene código
    Try this

    <Runtime.InteropServices.DllImport("winmm.dll")> _
        Public Shared Function waveOutSetVolume(ByVal hwo As IntPtr, ByVal dwVolume As UInteger) As Integer
        End Function
    
    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
             
            Dim NewVolume As Integer = ((UShort.MaxValue / 10) * TrackBar1.Value)
            ' Set the same volume for both the left and the right channels 
            Dim NewVolumeAllChannels As UInteger = ((CUInt(NewVolume) And &HFFFF) Or (CUInt(NewVolume) << 16))
            ' Set the volume 
            waveOutSetVolume(IntPtr.Zero, NewVolumeAllChannels)
            
        End Sub
    
    kaymaf
    If that what you want, take it. If not, ignored it and no complain
    • Marcado como respuestaDarkhalodude jueves, 05 de noviembre de 2009 13:52
    •  

Todas las respuestas

  • miércoles, 04 de noviembre de 2009 23:10jwavila Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
  • jueves, 05 de noviembre de 2009 1:52kaymaf Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     RespondidaTiene código
    Try this

    <Runtime.InteropServices.DllImport("winmm.dll")> _
        Public Shared Function waveOutSetVolume(ByVal hwo As IntPtr, ByVal dwVolume As UInteger) As Integer
        End Function
    
    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
             
            Dim NewVolume As Integer = ((UShort.MaxValue / 10) * TrackBar1.Value)
            ' Set the same volume for both the left and the right channels 
            Dim NewVolumeAllChannels As UInteger = ((CUInt(NewVolume) And &HFFFF) Or (CUInt(NewVolume) << 16))
            ' Set the volume 
            waveOutSetVolume(IntPtr.Zero, NewVolumeAllChannels)
            
        End Sub
    
    kaymaf
    If that what you want, take it. If not, ignored it and no complain
    • Marcado como respuestaDarkhalodude jueves, 05 de noviembre de 2009 13:52
    •