Sound is increasing

  • Thread starter Thread starter meeraluv
  • Start date Start date
M

meeraluv

Guest
The requirement is--> Webbrowser with tabs and youtube need to embed in that.when it loads first time,(if the system sound is mute or low) it should unmute/increase to 90% system volume.

The below code is working for me, when the system is in mute/0 volume,it is making system sound as 90%.I had put one timer in this..which will enable every 10 sec. so during the second enable.. it is making the sound to 100%,that means it is adding 90 again to the existing sound.bcz the sound of the system sound is 100 ,it is maximising.. How will i make it to constant 90% with this code. Kindly help


Option Strict On
Imports System.Runtime.InteropServices
Public Class Form1
Dim Volx As Int32
Private Const APPCOMMAND_VOLUME_UNMUTE As Integer = &HA0000
Private Const WM_APPCOMMAND As Integer = &H319
Private Const APPCOMMAND_VOLUME_DOWN As Integer = &H60000
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
End Sub
<DllImport("user32.dll")> Public Shared Function SendMessageW(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
End Function
Dim i As Integer = 0
Dim Count As Integer = 0
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

Do Until i = 45
SendMessageW(Me.Handle, WM_APPCOMMAND, Me.Handle, New IntPtr(APPCOMMAND_VOLUME_UNMUTE))
i += 1
Loop
i = 0
Timer1.Interval = 10000

End Sub

End Class

Continue reading...
 
Back
Top