ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

settings.c
Go to the documentation of this file.
00001 
00002 #include "magnifier.h"
00003 
00004 int iZoom = 3;
00005 
00006 BOOL bShowWarning = TRUE;
00007 
00008 BOOL bFollowMouse = TRUE;
00009 BOOL bFollowFocus = TRUE;
00010 BOOL bFollowCaret = TRUE;
00011 
00012 BOOL bInvertColors = FALSE;
00013 BOOL bStartMinimized = FALSE;
00014 BOOL bShowMagnifier = TRUE;
00015 
00016 void LoadSettings()
00017 {
00018     HKEY hkey;
00019     LONG value;
00020     ULONG len;
00021 
00022     RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Magnify"), 0,
00023         _T(""), 0, KEY_READ, NULL, &hkey, NULL);
00024 
00025     if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("StationaryMagLevel"),  0, 0, (BYTE *)&value, &len))
00026     {
00027         if(value >= 0 && value <= 9)
00028             iZoom  = value;
00029     }
00030 
00031     if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("ShowWarning"), 0, 0, (BYTE *)&value, &len))
00032         bShowWarning = (value == 0 ? FALSE : TRUE);
00033 
00034     if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("StationaryInvertColors"), 0, 0, (BYTE *)&value, &len))
00035         bInvertColors = (value == 0 ? FALSE : TRUE);
00036 
00037     if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("StationaryStartMinimized"), 0, 0, (BYTE *)&value, &len))
00038         bStartMinimized = (value == 0 ? FALSE : TRUE);
00039 
00040     if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("StationaryTrackCursor"), 0, 0, (BYTE *)&value, &len))
00041         bFollowMouse = (value == 0 ? FALSE : TRUE);
00042 
00043     if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("StationaryTrackFocus"), 0, 0, (BYTE *)&value, &len))
00044         bFollowFocus = (value == 0 ? FALSE : TRUE);
00045 
00046     if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("StationaryTrackSecondaryFocus"), 0, 0, (BYTE *)&value, &len))
00047         bFollowFocus = (value == 0 ? FALSE : TRUE);
00048 
00049     if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("StationaryTrackText"), 0, 0, (BYTE *)&value, &len))
00050         bFollowCaret = (value == 0 ? FALSE : TRUE);
00051 
00052     RegCloseKey(hkey);
00053 }
00054 
00055 void SaveSettings()
00056 {
00057     HKEY hkey;
00058     LONG value;
00059 
00060     RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Magnify"), 0,
00061         _T(""), 0, KEY_WRITE, NULL, &hkey, NULL);
00062 
00063     value = iZoom;
00064     RegSetValueEx(hkey, _T("StationaryMagLevel"), 0, REG_DWORD, (BYTE *)&value, sizeof value);
00065 
00066     value = bShowWarning;
00067     RegSetValueEx(hkey, _T("ShowWarning"), 0, REG_DWORD, (BYTE *)&value, sizeof value);
00068 
00069     value = bInvertColors;
00070     RegSetValueEx(hkey, _T("StationaryInvertColors"), 0, REG_DWORD, (BYTE *)&value, sizeof value);
00071 
00072     value = bStartMinimized;
00073     RegSetValueEx(hkey, _T("StationaryStartMinimized"), 0, REG_DWORD, (BYTE *)&value, sizeof value);
00074 
00075     value = bFollowMouse;
00076     RegSetValueEx(hkey, _T("StationaryTrackCursor"), 0, REG_DWORD, (BYTE *)&value, sizeof value);
00077 
00078     value = bFollowFocus;
00079     RegSetValueEx(hkey, _T("StationaryTrackFocus"), 0, REG_DWORD, (BYTE *)&value, sizeof value);
00080 
00081     value = bFollowFocus;
00082     RegSetValueEx(hkey, _T("StationaryTrackSecondaryFocus"), 0, REG_DWORD, (BYTE *)&value, sizeof value);
00083 
00084     value = bFollowCaret;
00085     RegSetValueEx(hkey, _T("StationaryTrackText"), 0, REG_DWORD, (BYTE *)&value, sizeof value);
00086 
00087     RegCloseKey(hkey);
00088 }

Generated on Sat May 26 2012 04:15:31 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.