Question

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?

Was it helpful?

Solution

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);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top