简体   繁体   中英

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

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);
   }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM