Created
August 15, 2012 02:18
-
-
Save xingfuqiu/3354996 to your computer and use it in GitHub Desktop.
C++:win7单进程静音h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VistaVolume.h | |
#ifndef _VISTAVOLUME_H_ | |
#define _VISTAVOLUME_H_ | |
#include <Windows.h> | |
#include <Mmdeviceapi.h> // for IMMDeviceEnumerator and IMMDevice | |
#include <Endpointvolume.h> // for IAudioEndpointVolume, must #define NTDDI_VERSION NTDDI_WINXPSP1 in stdafx.h | |
#include <Audiopolicy.h> | |
#include <Audioclient.h> | |
class CVistaVolume | |
{ | |
public: | |
CVistaVolume(); | |
~CVistaVolume(); | |
public: | |
HRESULT Init(); | |
HRESULT Uninit(); | |
HRESULT SetVolume(float fVolume); | |
HRESULT GetVolume(float *pfVolume); | |
HRESULT SetMute(BOOL bMute); | |
BOOL GetMute(); | |
private: | |
IMMDeviceEnumerator *m_pEnumerator; | |
BOOL m_bMute; | |
}; | |
#endif //_VISTAVOLUME_H_ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment