Click here to Skip to main content
15,896,063 members
Articles / Programming Languages / C++

Set Audio Endpoints System Wide in Vista/Windows 7

Rate me:
Please Sign up or sign in to vote.
4.43/5 (4 votes)
7 Jan 2011CPOL3 min read 81.2K   2.7K   10  
An article on how to set system wide audio endpoints programmatically.
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="9,00"
	Name="AudioConfigManager"
	ProjectGUID="{8FF3BEE8-EEF9-4077-9FE0-8AB71961E8CA}"
	RootNamespace="AudioConfigManager"
	Keyword="ManagedCProj"
	TargetFrameworkVersion="131072"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="1"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
			CharacterSet="2"
			ManagedExtensions="4"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				PreprocessorDefinitions="WIN32;_DEBUG;MYDEBUG"
				MinimalRebuild="false"
				BasicRuntimeChecks="0"
				RuntimeLibrary="3"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				Detect64BitPortabilityProblems="false"
				DebugInformationFormat="3"
				CompileAs="0"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				OutputFile="$(OutDir)\$(ProjectName).exe"
				LinkIncremental="2"
				GenerateDebugInformation="true"
				AssemblyDebug="1"
				SubSystem="2"
				OptimizeForWindows98="0"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				CLRUnmanagedCodeCheck="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="1"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
			CharacterSet="2"
			ManagedExtensions="4"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
				Description="Running Ngen..."
				CommandLine="&quot;C:\Program Files\AudioConfigManager\Release\RunNgen.bat&quot;&#x0D;&#x0A;&#x0D;&#x0A;"
				Outputs="&quot;C:\Program Files\AudioConfigManager\Release\RunNgen.txt&quot;"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				FavorSizeOrSpeed="0"
				PreprocessorDefinitions="WIN32;NDEBUG"
				MinimalRebuild="false"
				BasicRuntimeChecks="0"
				RuntimeLibrary="2"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				Detect64BitPortabilityProblems="true"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="WinMM.lib setupapi.lib"
				OutputFile="$(OutDir)\$(ProjectName).exe"
				LinkIncremental="1"
				GenerateDebugInformation="true"
				SubSystem="2"
				OptimizeForWindows98="1"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
		<AssemblyReference
			RelativePath="System.Drawing.dll"
			AssemblyName="System.Drawing, Version=2.0.0.0, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
			MinFrameworkVersion="131072"
		/>
		<AssemblyReference
			RelativePath="Microsoft.VisualC.Dll"
			AssemblyName="Microsoft.VisualC, Version=8.0.0.0, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
			MinFrameworkVersion="131072"
		/>
		<AssemblyReference
			RelativePath="System.dll"
			AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
			MinFrameworkVersion="131072"
		/>
		<AssemblyReference
			RelativePath="System.Windows.Forms.dll"
			AssemblyName="System.Windows.Forms, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
			MinFrameworkVersion="131072"
		/>
	</References>
	<Files>
		<Filter
			Name="Source Files"
			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
			>
			<File
				RelativePath=".\AssemblyInfo.cpp"
				>
			</File>
			<File
				RelativePath=".\AudioDeviceSwitcher.cpp"
				>
			</File>
			<File
				RelativePath=".\ErrorMessageBox.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						DebugInformationFormat="3"
						CompileAsManaged="4"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\Form1.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						DebugInformationFormat="3"
						CompileAsManaged="4"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\HandleAcquirer.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						CompileAsManaged="4"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\stdafx.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						UsePrecompiledHeader="1"
						DebugInformationFormat="3"
						CompileAsManaged="4"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						UsePrecompiledHeader="1"
					/>
				</FileConfiguration>
			</File>
		</Filter>
		<Filter
			Name="Header Files"
			Filter="h;hpp;hxx;hm;inl;inc;xsd"
			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
			>
			<File
				RelativePath=".\AudioDeviceSwitcher.h"
				>
			</File>
			<File
				RelativePath=".\ErrorMessageBox.h"
				>
			</File>
			<File
				RelativePath=".\Form1.h"
				FileType="3"
				>
				<File
					RelativePath=".\Form1.resX"
					SubType="Designer"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCManagedResourceCompilerTool"
							ResourceFileName="$(IntDir)/AudioConfigManager.Form1.resources"
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCManagedResourceCompilerTool"
							ResourceFileName="$(IntDir)/AudioConfigManager.Form1.resources"
						/>
					</FileConfiguration>
				</File>
			</File>
			<File
				RelativePath=".\HandleAcquirer.h"
				>
			</File>
			<File
				RelativePath=".\resource.h"
				>
			</File>
			<File
				RelativePath=".\stdafx.h"
				>
			</File>
			<File
				RelativePath=".\UserDefines.h"
				>
			</File>
		</Filter>
		<Filter
			Name="Resource Files"
			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
			>
			<File
				RelativePath=".\app.rc"
				>
			</File>
		</Filter>
		<File
			RelativePath=".\ReadMe.txt"
			>
		</File>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Retired
France France
Used to own a software development enterprise from the late 70's to the mid 90's, worked as systems analyst/programmer in that enterprise

Comments and Discussions