DECLARE INTEGER waveOutGetVolume IN winmm NTEGER hwo, INTEGER @pdwVolume
DECLARE INTEGER waveOutSetVolume IN winmm INTEGER hwo, INTEGER dwVolume
was available on windows XP to get/set the PC master audio volume.
not work on vista and above at all.even running app with windows xp (pack3) compatibility dont work!
since Windows Vista/7 MS changed the access to control volume, mixers, etc. and it's called the coreaudio API.
IAudioEndpointVolume interface :
https://msdn.microsoft.com/en-us/library/aa964574.aspx https://msdn.microsoft.com/en-us/library/ms678749.aspxThis is part of the new audio APIs that were released in Windows Vista, and it can be used to get or set the master volume.
This undertaking is made considerably easier by the fact that we do not need to support versions of Windows prior to Vista (namely Windows XP),
because there were substantial changes made to the relevant infrastructure between those OS releases.
This is likely the reason why the existing samples (github VFPX win32api) tried didn't work properly.
Note: to increase/decrease/mute master volume its easy with sendMessage and constants or with shell scripts(sendkeys).
To get the master volume programmatly with vfp9 i think its yet not possible at this time.("appeal to amateurs")
i found a small DOS utility as exe (32ko) to do that in:
https://sourceforge.net/projects/mplayer-edl/files/adjust_get_current_system_volume_vista_plus.exe/downloadcan be manipulated easily with a bat file and shellexecute API to return the current master volume (and to set it also)