Visual Basic - PC Lautstärke setzen?

... komplette Frage anzeigen

1 Antwort

Private Const APPCOMMAND_VOLUME_MUTE As Integer = &H80000
Private Const APPCOMMAND_VOLUME_UP As Integer = &HA0000
Private Const APPCOMMAND_VOLUME_DOWN As Integer = &H90000
Private Const WM_APPCOMMAND As Integer = &H319

<DllImport("user32.dll")> Public Function SendMessageW(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
End Function

<DllImport("kernel32.dll")> _
Private Function GetConsoleWindow() As IntPtr
End Function

Private Sub VolumeMute()
SendMessageW(Me.Handle, WM_APPCOMMAND, Me.Handle, New IntPtr(APPCOMMAND_VOLUME_MUTE))
End Sub

Private Sub VolumeIncrease()
SendMessageW(Me.Handle, WM_APPCOMMAND, Me.Handle, New IntPtr(APPCOMMAND_VOLUME_UP))
End Sub

Private Sub VolumeDecrease()
SendMessageW(Me.Handle, WM_APPCOMMAND, Me.Handle, New IntPtr(APPCOMMAND_VOLUME_DOWN))
End Sub


MFG xGlumi

Antwort bewerten Vielen Dank für Deine Bewertung