调出系统音频设置




所以通过调用线程的方式 ,调出这个窗口

OnCommandSoundOptions()
{
    STARTUPINFO StartupInfo = {0};
    StartupInfo.cb =  sizeof(StartupInfo);

    PROCESS_INFORMATION ProcessInfo = {0};
    RtlZeroMemory(&ProcessInfo, sizeof(ProcessInfo));

    WCHAR wszCommandLine[] = L"control.exe mmsys.cpl";
    const auto bProcessCreated = 
        ::CreateProcess(
            nullptr,
            wszCommandLine,
            nullptr,
            nullptr,
            FALSE,
            0,
            nullptr,
            nullptr,
            &StartupInfo,
            &ProcessInfo);
    if (!bProcessCreated)
        throw CError( MakeDefaultErrorDescription(L"::CreateProcess") );

    ::CloseHandle(ProcessInfo.hProcess);
    ::CloseHandle(ProcessInfo.hThread);
}




猜你喜欢

转载自blog.csdn.net/shuilan0066/article/details/80365333