How do I change (increase/decrease/mute) the audio volume in Windows? I want to change the global volume, not just wave or CD. I tried to read some Platform SDK stuff about it but... I can't handle it ;) I guess, some code that I could copy&paste would do the job...
Posted on 2002-04-15 16:43:23 by marcinbu
Oh, I forgot. I've found two easy ways to achieve it but I can' use the first and I can't get the socond working under XP (under 2k it works fine).

1st method - the keybd_event API with VK_VOLUME_UP/DOWN/MUTE

2nd method - SendMessage, hwnd, 0C02Ah, 0Ch, 080000h (for mute, 0A0000h for VolUp and 090000h for VolDown), where hwnd is a handle of a window whose class name is "MM Notify Callback" under 2k or "MSTaskSwWClass" under XP. I discovered this method by debugging Windows. I can't get it work under XP bacause I can't get the hwnd with FindWindow - don't know why...
Posted on 2002-04-15 16:53:42 by marcinbu
The proper way of doing it is - probably - through the ugly MCI API.
Your methods seem pretty hacky ;)
Posted on 2002-04-17 07:41:51 by f0dder
I never tested it, but I heard of it:

"auxSetVolume" API function
Posted on 2002-04-17 07:53:05 by beaster