I recently had this problem when trying to make a remote control circuit to control my PC volume and other functions... It seems that most code for vb which achieves this goal is unsuccessful because it just gives you local application volume control!
Being more of a C++ programmer myself I actually used some suggestions from various sites to build a simple DLL that I could call from vb (attached). I don't think it will work for XP but it worked on my Vista system...
To Call:
VBCode Code:
Private Declare Function GetVolume Lib "SystemHWInterface.dll" () As Double
Private Declare Sub SetVolume Lib "SystemHWInterface.dll" (ByVal volume As Double)
'Get volume
Dim dVolumeLevel As Double
dVolumeLevel = GetVolume()
'Set volume to 50%
SetVolume(0.5)
Note that it gives you control of the master volume as a percentage.
Hope this helps some of you guys out!