Master Volume Control

  • Thread starter Thread starter Jon Berry
  • Start date Start date
J

Jon Berry

Visual Studio 2005, C#

Does anyone know an easy way to control Windows master volume control from a
C# app?

I need something that will work on Vista & XP.

Is this possible with SendKeys?

Thanks!
 
I actually went to find out the same thing myself. The only solution
I could find was to do a pinvoke against the Windows api.

[DllImport("winmm.dll", SetLastError=true, CharSet=CharSet.Auto)]
private static extern int waveOutGetVaolume(IntPtr hwo, out uint
dwVolume);

[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
private static extern int waveOutSetVolume(IntPtr uDeviceID, uint
dwVolume);
 
Back
Top