Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get PC audio volume
Message
From
30/03/2018 17:00:18
 
 
To
30/03/2018 04:05:04
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01659066
Message ID:
01659073
Views:
91
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.aspx
This 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/download
can be manipulated easily with a bat file and shellexecute API to return the current master volume (and to set it also)
Previous
Reply
Map
View

Click here to load this message in the networking platform