2

What is the API used to know whether the volume is mute or not in Pocket PC 2003 environment using c++?

To set volume, I have used the following API:-

waveOutSetVolume(0,volume[volumeStatus.volume]); 

And to get volume, I have used the following API:-

waveOutGetVolume(0, (LPDWORD)&volume);

Please let me know what is the API for setting and getting Mute status?

Abhineet
  • 6,459
  • 10
  • 35
  • 53
  • Could anyone tell me please that what is the api used for the above? – Abhineet Feb 06 '12 at 07:02
  • Get the volume and check if it's zero? – Some programmer dude Feb 06 '12 at 07:03
  • In Pocket PC 2003 environement, The MIXERLINE concepts for getting & setting the mute status is not working. Also i am not able to set and get the volume level using MIXERLINE concepts. So i am using waveoutgetvolume & waveoutsetvolume api in pocketpc 2003 environment. – Abhineet Feb 06 '12 at 07:05
  • @Joachim Pileborg: I dont need volume level, we can get volume level by waveoutgetvolume but we will not get mute status. I mean to say whether mute is checked or not. For this, there must be some API which can check the mute status. – Abhineet Feb 06 '12 at 07:29

1 Answers1

0

I got the solution for the above:

Method to Get Mute status:

    void vGetMuteStatus(){
    LONG lReturn; 
        HKEY hkey; 
        DWORD dwLen, dwMode;     
        lReturn = RegOpenKeyEx(HKEY_CURRENT_USER,
                    L"ControlPanel\\Notifications\\ShellOverrides",
                    0,KEY_QUERY_VALUE|KEY_READ,&hkey);    
        if (lReturn == ERROR_SUCCESS)    {       
            dwLen = sizeof(DWORD);       
            lReturn = RegQueryValueEx(hkey,L"Mode", NULL, NULL,
                               (LPBYTE)&dwMode, &dwLen);       
            RegCloseKey(hkey);    
        } 
        if(dwMode == 2)
            MSGBOX(NULL,L"Volume",L"Volume is Mute",MB_OK);
        else
            MSGBOX(NULL,L"Volume",L"Volume is not Mute",MB_OK);
}
Abhineet
  • 6,459
  • 10
  • 35
  • 53