Volume controle

Controle the device volume from within your VB20xx application.
Tested with Friendlyarm Mini2440 running on win CE6.0 and Visual Basic 2008.

 Public Class Form1

    Public Declare Function waveOutSetVolume Lib "coredll.dll" (ByVal hwo As IntPtr, ByVal dwVolume As Long) As Integer
    Public Declare Function waveOutGetVolume Lib "coredll.dll" (ByVal hwo As IntPtr, ByRef pdwVolume As Long) As Integer


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        waveOutSetVolume(0, 40000) 'Sets the volume to 40000
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim i As Long
        waveOutGetVolume(0, i)
        Debug.WriteLine("Current volume setting: " & i)
    End Sub
End Class