Quitar Sonido a Windows Vista

Iniciado por Cj2009z, 4 Agosto 2008, 19:49 PM

0 Miembros y 1 Visitante están viendo este tema.

Cj2009z

Hola amigos, veran he logrado quitar el sonido temporalmente a WindowsXP pero no logro q funciona para windows vista este es el code:

algunas API:


Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Private Const BM_GETCHECK = &HF0
Private Const BM_CLICK = &HF5
Private Const WM_SYSCOMMAND = &H112
Private Const SC_CLOSE = &HF060&

Dim Hndl As Long
Dim chekeo As Long


Esto va en un CommandBottom:


If Dir("C:\Windows\System32\Sndvol.exe") <> "" Then 'VISTA
        Shell "C:\Windows\System32\Sndvol.exe", vbHide
        Hndl = FindWindow("Volume Control", "Mezclador de volumen")
        Hndl = FindWindowEx(Hndl, 0, "Button", "&Silecio")
        chekeo = SendMessage(Hndl, BM_GETCHECK, 0, 0)
If chekeo = 1 Then Call SendMessage(Hndl, BM_CLICK, 0, 0)
        Hndl = FindWindow("Volume Control", "Mezclador de volumen")
        Call SendMessage(Hndl, WM_SYSCOMMAND, SC_CLOSE, CLng(0))
End If


espero que me puedan ayudar y gracias por todo buena suerte...