Solved

Disable Sound

Posted on 2004-09-15
5
271 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

685 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