All Forums
 Microsoft Windows CE
 General CE
 Updating audio volume settings
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 17 Mar 2006 :  11:37:25  Show Profile  Email Poster
Q: I'd like to adjust the audio settings for my device at run time. I've found that the control panel adjusts some registry keys when changes are made, but when I alter them manually or through code it doesn't take effect until I restart the device. How can I get my changes to take effect without a restart?

The following registry keys are used for system volume:

[HKEY_CURRENT_USER\ControlPanel\Volume]
  "Key"=dword:10002
  "Screen"=dword:10002
  "Mute"=dword:7
  "Volume"=dword:FFFFFFFF


Since the keys don't change frequently, the audio driver only reads the registry keys when it boots, or is explicitly told to do so (which is what the Control Panel does). Your application can tell the driver to reload the setting by calling the AudioUpdateFromRegistry API. Here's the declaration, depending on your language preference:

C/C++
#ifdef __cplusplus
extern "C"
#endif
void AudioUpdateFromRegistry();

C#
[DllImport("coredll.dll")]
public static extern void AudioUpdateFromRegistry();

VB.NET
_
Private Shared Sub AudioUpdateFromRegistry()
End Function

mflynn

3 Posts

Posted - 17 Mar 2006 :  13:08:21  Show Profile  Email Poster
This solution does not seem to work for me still.

I can change the volume (via the key you mentioned) in software and I can see it change in the Registry. However, calling AudioUpdateFromRegistry() seems to make no difference in volume. I'm changing the value in this order (same as doing so from Control Panel).

0 - 0x33333333 - 0x66666666 - 0x99999999 - 0xCCCCCCCC - 0xFFFFFFFF
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000