Solved

Disable Sound

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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++.

832 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