If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video) My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet Social Group:VBForums - Developers from India
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video) My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet Social Group:VBForums - Developers from India
i using windows 7
this like waveOutSetVolume api
If this code works in which the program is opening voice of that program (not sound of system)
I don't understand your statement. I ran that code while playing an existing .mpg on my HD. It sure enough controlled the volume at system level. What is needed is... another function (when you close your app) that resets the volume to whatever it was set at prior to calling the SetVolume function,
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing??
I found this in the KPD Team API Guide and I'm posting it as is. This code reads the current system volume and also sets it. The code is raw and needs cleaning up as well as dressing up but that will leave something for you to do. A SliderControl (Vol Control) will be a nice mod. This code is also minimalist, which leaves plenty of room for you to grow it to your liking!
Code:
Option Explicit
'Example submitted by Danjel Nyberg KPD API Guide
'It needs a textbox (Text1) and two command buttons (Command1, Command2)
Private Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer, ByVal dwVolume As Long) As Integer
Private Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer, dwVolume As Long) As Integer
Private Sub Command1_Click()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
Text1 = CLng(tmp)
End Sub
Private Sub Command2_Click()
Dim a, i As Long
Dim tmp, vol As String
vol = Text1
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Sub
Last edited by CDRIVE; Sep 5th, 2010 at 06:29 PM.
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing??
Sorry, I just got the drift of what you were desiring (No system level control). I guess your going to need a MMControl in your proj unless there's another way.
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing??
Your subject title says System Volume. Your image seems to indicate same but it's not english, so I'm still not sure.
Last edited by CDRIVE; Sep 5th, 2010 at 05:12 PM.
Reason: Removed image to save space
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing??
I haven't used a MMControl in years and when I did it wasn't much. I was quite surprised to find no volume control on it when I checked it today!
Last edited by CDRIVE; Sep 5th, 2010 at 10:35 PM.
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing??
I found this in the KPD Team API Guide and I'm posting it as is. This code reads the current system volume and also sets it. The code is raw and needs cleaning up as well as dressing up but that will leave something for you to do. A SliderControl (Vol Control) will be a nice mod. This code is also minimalist, which leaves plenty of room for you to grow it to your liking!
Code:
Option Explicit
'Example submitted by Danjel Nyberg KPD API Guide
'It needs a textbox (Text1) and two command buttons (Command1, Command2)
Private Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer, ByVal dwVolume As Long) As Integer
Private Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer, dwVolume As Long) As Integer
Private Sub Command1_Click()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
Text1 = CLng(tmp)
End Sub
Private Sub Command2_Click()
Dim a, i As Long
Dim tmp, vol As String
vol = Text1
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Sub
I've tried it and it works, The only problem is that the code modifies the volume of the wave, not the general volume. How ca I fix that?
I found a project on planet source code and works on windows 7 here is the project... i tried to simplify it which didnt work i will have to look into it a bit more or maybe someone could simplify it... here is the project
Last edited by Max187Boucher; Dec 8th, 2012 at 10:33 PM.
I've also found a code in psc.com and it works for the Volume Control. I've tried the code posted just above this post and it doesn't works for me in Xp. Maybe the code needs to be modified in some way to adapt it because vb shows some errors while compiling.
Did you load the .bas module that is missing but its actually in The folder you just need to add the file its the timer(something).bas
It workes the first time for me then did not work and it worked again once i restarted... There is something with the api's thats being mixed or not working like it should on different OS i guess not too sure i dont know anything about those api openmixer etc....
As you say, one of the *.bas files was missed and you need to add it in the project. If not, the program shows to you an error. So I loaded the bas file before running the program.