AudioSessionControl::SetIconPath no longer works volume mixers besides SndVol

rizhang 1 Reputation point
2024-09-20T00:35:34.35+00:00

We have multiple HWNDs and volume controls in the same process so we want to set the icon for each volume control differently.

AudioSessionControl::SetDisplayName works fine across all Windows volume mixers (ie. SndVol, "Windows + G" dashboard, and the mixer inside the settings app).

AudioSessionControl::SetIconPath only works for SndVol. The other volume mixers will set all the volume controls to whatever the icon of the foreground HWND is, so the result is volume controls with the same icons.

Will this issue be fixed and is there a workaround for this?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,609 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Junjie Zhu - MSFT 17,806 Reputation points Microsoft Vendor
    2024-09-27T08:52:35.1633333+00:00

    Hi @rizhang ,

    Welcome to Microsoft Q&A!

    WM_SETICON was not called in my test, so I did not reproduce the same behavior at first.

    According to the remarks in the document of IAudioSessionControl::GetIconPath and IAudioSessionControl::SetIconPath.

    If a client has not called IAudioSessionControl::SetIconPath to set the display icon, the string will be empty. If no client-specified icon is available, the Sndvol program uses the icon from the client's application window to label the volume control for the audio session.

    If the client does not call SetIconPath to assign an icon to the session, the Sndvol program uses the icon from the application window as the default icon for the session.

    This should be by design. After using WM_SETICON, AudioSessionControl::SetIconPath does not work for the icons in the Settings and mixer. IAudioSessionControl::SetIconPath only works for Sndvol program.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.