System Volume Control
- 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
Answers
- Try this
kaymaf<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
If that what you want, take it. If not, ignored it and no complain- Marked As Answer byDarkhalodude Thursday, November 05, 2009 1:52 PM
All Replies
- some good help from Martin here
http://social.msdn.microsoft.com/forums/en-US/Vsexpressvb/thread/a828db57-d7b7-4740-92bc-c95a3c1f78e1/ - Try this
kaymaf<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
If that what you want, take it. If not, ignored it and no complain- Marked As Answer byDarkhalodude Thursday, November 05, 2009 1:52 PM


