Master Volume Control

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!
 
G

Gregory Emerson

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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top