Search code examples
c++registryvolumepocketpcmute

How to read values from registry in Pocket PC 2003 using c++?


I have to get the current Mute state from the following registry values as mentioned below:-

For PPC 2002/2003:

\HKCU\ControlPanel\Notifications\ShellOverrides\Mode 
  • 2 for Mute mode.
  • 0 for Not-mute mode.

Not sure if other bits are used here for other things.

Thanks


Solution

  • Is this what you're looking for?

    LONG lReturn;
    HKEY hkey;
    DWORD dwLen, dwMode;
    
       lReturn = RegOpenKeyEx(HKEY_CURRENT_USER,"ControlPanel\\Notifications\\ShellOverrides",0,KEY_QUERY_VALUE|KEY_READ,&hkey);
       if (lReturn == ERROR_SUCCESS)
       {
          dwLen = sizeof(DWORD);
          lReturn = RegQueryValueEx(hkey,"Mode", NULL, NULL,(LPBYTE)&dwMode, &dwLen);
          RegCloseKey(hkey);
       }