Solved

Disable Sound

Posted on 2004-09-15
5
264 Views
Last Modified: 2010-04-01
Is there a way to mute speakers with a console app?  For example, I want to put the program in "Start Up", so each time there is a login, it mutes the speakers and then disappears.  Thanks!

Regards,
Tony
0
Comment
Question by:fattumsdad
  • 2
  • 2
5 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 12066389
0
 
LVL 1

Author Comment

by:fattumsdad
ID: 12066444
That would be great...  but I want to do it from console, not using MFC.  Thanks :)

Regards,
Tony
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 12066619
Just use

#include <windows.h>
#include <mmsystem.h>

int main () {

    waveOutSetVolume ( 0, 0);

}

and link with winmm.lib
0
 
LVL 86

Expert Comment

by:jkr
ID: 12066740
BTW, for more info, see http://support.microsoft.com/default.aspx?scid=kb;en-us;139098 ("How to Use Wave Audio Volume Control APIs")
0
 
LVL 1

Author Comment

by:fattumsdad
ID: 12066874
Thanks, I'll check that out!!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to programmatically differentiate between C and Java 10 204
Embarcadero C++ Builder XE2 TDateTime 8 75
Best book to learn C++ 4 83
learn programming 8 28
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

790 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