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...
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...
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...
The proper way of doing it is - probably - through the ugly MCI API.
Your methods seem pretty hacky ;)
Your methods seem pretty hacky ;)
I never tested it, but I heard of it:
"auxSetVolume" API function
"auxSetVolume" API function