Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

mciSendString

Posted on 1998-09-09
6
Medium Priority
?
338 Views
Last Modified: 2010-05-18
Using VB5 and the API call (mciSendString), i have built a CD player. Everything works fine except i want to add a
volume control to the program using the same API call. I
can't figure out how to do that one. Could you show me how
this is done?
0
Comment
Question by:poorboy
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1434007
You mean you want to open the default Windows' volume control???

//Viktor
0
 

Author Comment

by:poorboy
ID: 1434008
I have placed a SLIDER CONTROL on my form and i would like to change the volume
using it. Is there an API call i can use to do this?
0
 

Author Comment

by:poorboy
ID: 1434009
Adjusted points to 30
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
sjrl earned 60 total points
ID: 1434010
You can do this via API calls, but you need to use the waveOutSetVolume function in MMSYSTEM.DLL. There is also a waveOutGetVolume function.
0
 

Author Comment

by:poorboy
ID: 1434011
The API call waveOutSetVolume and waveOutGetVolume are new to me. Both functions
are indentical except for one letter. Here is the full function call for one of them.
"Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long" Could you tell me how to get the (uDeviceID) in the call.
I assume that (dwVolume) means the value of my slider control. If this is wrong please let me know.
0
 

Expert Comment

by:sjrl
ID: 1434012
I think you need to use the waveOutGetNumDevs to find out how many playback devices there are. Then use the waveOutGetDevCaps to iterate through these until you find the desired device number. This number is uDeviceID.
dwVolume is a DWORD. The loworder word specifies the left channel, the high order the right.
So 0xFF00 represents silence on the left, full volume on the right.
0x00FF represents silence on the right, full volume on the left.
0xFFFF represents silence on the left, full volume on the right.
0x0000 represents silence.
0xFFFF represents full volume.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question