[SNDVOL32] Read the Style value from the registry and use it as the default display...
[reactos.git] / base / applications / sndvol32 / misc.c
index 2eabfc9..670fa12 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* $Id$
- *
+/*
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS Sound Volume Control
- * FILE:        subsys/system/sndvol32/misc.c
+ * FILE:        base/applications/sndvol32/misc.c
  * PROGRAMMERS: Thomas Weidenmueller <w3seek@reactos.com>
  */
+
 #include "sndvol32.h"
 
+#include <winreg.h>
 
 static INT
 LengthOfStrResource(IN HINSTANCE hInst,
@@ -272,3 +273,29 @@ ExitClose:
 
     return Ret;
 }
+
+DWORD
+GetStyleValue(VOID)
+{
+    HKEY hOptionsKey;
+    DWORD dwStyle = 0, dwSize;
+
+    if (RegOpenKeyEx(hAppSettingsKey,
+                     AppOptionsKey,
+                     0,
+                     KEY_READ,
+                     &hOptionsKey) == ERROR_SUCCESS)
+    {
+        dwSize = sizeof(DWORD);
+        RegQueryValueEx(hOptionsKey,
+                        StyleValue,
+                        NULL,
+                        NULL,
+                        (LPBYTE)&dwStyle,
+                        &dwSize);
+
+        RegCloseKey(hOptionsKey);
+    }
+
+    return dwStyle;
+}