Click here to Skip to main content
15,894,546 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.
#pragma once

#include <tchar.h>
#include "ErrorMessageBox.h"

namespace AudioConfigManager
{
using namespace System;

__delegate bool Callback(HWND handle,int *x);

public __gc class HandleAcquirer
	{
	private: _TCHAR		*TargetType;
	private: _TCHAR		*TargetLabel;
	private: Callback	*callbackSearch;

	private: bool setTargetType(const _TCHAR *type);
	private: bool setTargetLabel(const _TCHAR *label);
	private: void setNullLabel(void);
	public: HandleAcquirer(System::Void); //constructor
	private: bool getChildWindow(HWND handle,int *x);
	public: HWND findChildWindow(HWND parent,const _TCHAR *type,const _TCHAR *label);
	public: void ifAppletRunningKillIt(const _TCHAR *appletWindowTitle);
	public: HWND launchApplet(const _TCHAR *appletName,const _TCHAR *appletWindowTitle);
	};
}

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