Solved

Disable Sound

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 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 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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now