Changing the volume of speaker/headphones of windows 7
<p>I need to control the volume of speakers and headphones connected to windows 7 system.<br>
I can able to control the volume of speakers by using the following code.  </p>

<pre><code> private const int APPCOMMAND_VOLUME_MUTE = 0x80000;
 private const int APPCOMMAND_VOLUME_UP = 0xA0000;
 private const int APPCOMMAND_VOLUME_DOWN = 0x90000;
 private const int WM_APPCOMMAND = 0x319;

    [DllImport("user32.dll")]
    public static extern IntPtr SendMessageW(IntPtr hWnd, int Msg,
        IntPtr wParam, IntPtr lParam);


    private void btnMute_Click(object sender, EventArgs e)
    {
        SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle,
            (IntPtr)APPCOMMAND_VOLUME_MUTE);
    }

    private void btnDecVol_Click(object sender, EventArgs e)
    {
        SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle,
            (IntPtr)APPCOMMAND_VOLUME_DOWN);
    }

    private void btnIncVol_Click(object sender, EventArgs e)
    {
        SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle,
            (IntPtr)APPCOMMAND_VOLUME_UP);

    }
</code></pre>

<p>But i cant able to control the volume of the headphones. Ref pic.<br>
<img src="http://i.stack.imgur.com/8z68E.png" alt="enter image description here"></p>

<p>How to control the volume of audio device shown in the pic??</p>
