Core Audio API控制windows音量

该代码使用Core Audio API控制Windows音量。开发环境包括VS 2019和Windows 10企业版2016长期服务版。示例代码包含`test.h`、`test.cpp`、`SystemVolume.h`和`SystemVolume.cpp`四个文件。`SystemVolume.cpp`中包含初始化、设置音量、获取音量、关闭服务等方法,并使用`IAudioEndpointVolume`接口控制音量。代码通过`CoInitialize`、`CoCreateInstance`等COM组件接口函数,完成音量控制功能。


C++获取运行exe路径和名称

This article presents two methods in C++ to obtain the path and name of the currently running executable. The first uses command-line arguments (argv[0]) and string manipulation to extract the information. The second employs a custom `PathUtil` class, leveraging `GetModuleFileNameA` to retrieve the full path and then parsing it to separate the filename. Both methods provide solutions for acquiring both the executable's path and its name.