ReactOS  0.4.15-dev-321-g2d9b385
settings.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SSSTARS
 

Macros

#define ROTATION_NONE   0
 
#define ROTATION_LINEAR   1
 
#define ROTATION_PERIODIC   2
 
#define ROTATION_ITEMS   3
 
#define MIN_STARS   10
 
#define MAX_STARS   500
 
#define MIN_SPEED   1
 
#define MAX_SPEED   100
 

Functions

void LoadSettings (void)
 
void SaveSettings (void)
 

Variables

SSSTARS Settings
 

Macro Definition Documentation

◆ MAX_SPEED

#define MAX_SPEED   100

Definition at line 33 of file settings.h.

◆ MAX_STARS

#define MAX_STARS   500

Definition at line 30 of file settings.h.

◆ MIN_SPEED

#define MIN_SPEED   1

Definition at line 32 of file settings.h.

◆ MIN_STARS

#define MIN_STARS   10

Definition at line 29 of file settings.h.

◆ ROTATION_ITEMS

#define ROTATION_ITEMS   3

Definition at line 27 of file settings.h.

◆ ROTATION_LINEAR

#define ROTATION_LINEAR   1

Definition at line 25 of file settings.h.

◆ ROTATION_NONE

#define ROTATION_NONE   0

Definition at line 24 of file settings.h.

◆ ROTATION_PERIODIC

#define ROTATION_PERIODIC   2

Definition at line 26 of file settings.h.

Function Documentation

◆ LoadSettings()

void LoadSettings ( void  )

Definition at line 53 of file settings.c.

54 {
55  HKEY hKey = NULL;
56  int iItemIndex = -1;
57 
59  {
60  TCHAR szBuffer[MAX_PATH];
61  DWORD dwAdvancedChecked;
62  DWORD type, size = sizeof(dwAdvancedChecked);
63  LSTATUS lstatus;
64 
65  /* Restore last selected font */
66  if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, _T("Font"), szBuffer, (sizeof(szBuffer)/sizeof(szBuffer[0]))) == ERROR_SUCCESS)
67  {
68  //Get combobox handle
70 
71  //Search for match and return index if match found
72  iItemIndex = ComboBox_FindStringExact(hWnd, -1, szBuffer);
73  if(iItemIndex != CB_ERR)
74  {
75  ComboBox_SetCurSel(hWnd, iItemIndex);
77  }
78  }
79 
80  /* Restore last selected character set */
81  if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, _T("CodePage"), szBuffer, (sizeof(szBuffer)/sizeof(szBuffer[0]))) == ERROR_SUCCESS)
82  {
83  //Get combobox handle
85 
86  iItemIndex = ComboBox_FindStringExact(hWnd, -1, szBuffer);
87  if(iItemIndex != CB_ERR)
88  {
89  ComboBox_SetCurSel(hWnd, iItemIndex);
90  }
91  }
92 
93  lstatus = RegQueryValueEx(hKey, _T("Advanced"), NULL, &type, (LPBYTE)&dwAdvancedChecked, &size);
94  if (lstatus == ERROR_SUCCESS && type == REG_DWORD && dwAdvancedChecked != FALSE)
95  {
97  }
98 
99  RegCloseKey(hKey);
100  }
101  else
102  {
103  /* Default font seems to be Arial */
105 
106  iItemIndex = ComboBox_FindStringExact(hWnd, -1, _T("Arial"));
107  if(iItemIndex != CB_ERR)
108  {
109  ComboBox_SetCurSel(hWnd, iItemIndex);
111  }
112  }
113 }
#define RegQueryValueEx
Definition: winreg.h:524
#define ERROR_SUCCESS
Definition: deptool.c:10
#define IDC_CHECK_ADVANCED
Definition: resource.h:26
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HWND hWnd
Definition: settings.c:17
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define SendDlgItemMessage
Definition: winuser.h:5817
#define IDC_COMBO_CHARSET
Definition: resource.h:21
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define ComboBox_FindStringExact(hwndCtl, indexStart, lpszFind)
Definition: windowsx.h:22
unsigned char * LPBYTE
Definition: typedefs.h:53
const TCHAR g_szGeneralRegKey[]
Definition: settings.c:16
smooth NULL
Definition: ftsmooth.c:416
#define CB_ERR
Definition: winuser.h:2410
#define MF_CHECKED
Definition: winuser.h:132
char TCHAR
Definition: xmlstorage.h:189
#define BM_CLICK
Definition: winuser.h:1899
#define _T(x)
Definition: vfdio.h:22
GLsizeiptr size
Definition: glext.h:5919
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define ComboBox_SetCurSel(hwndCtl, index)
Definition: windowsx.h:41
#define IDC_FONTCOMBO
Definition: resource.h:12
VOID ChangeMapFont(HWND hDlg)
Definition: charmap.c:113
LONG QueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTSTR pszBuffer, DWORD dwBufferLen)
Definition: settings.c:19
#define RegOpenKeyEx
Definition: winreg.h:520
HWND hCharmapDlg
Definition: charmap.c:22
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by _tWinMain(), MainDialogProc(), ScreenSaverConfigureDialog(), and wWinMain().

◆ SaveSettings()

void SaveSettings ( void  )

Definition at line 115 of file settings.c.

116 {
117  HKEY hKey = NULL;
118 
120  {
121  TCHAR szBuffer[MAX_PATH];
122 
124  ComboBox_GetText(hWnd, szBuffer, MAX_PATH);
125 
126  if(*szBuffer != '\0')
127  RegSetValueEx(hKey, _T("Font"), 0, REG_SZ, (LPBYTE) szBuffer, (DWORD) MAX_PATH);
128 
130  ComboBox_GetText(hWnd, szBuffer, MAX_PATH);
131 
132  if(*szBuffer != '\0')
133  RegSetValueEx(hKey, _T("CodePage"), 0, REG_SZ, (LPBYTE) szBuffer, (DWORD) MAX_PATH);
134 
135  RegSetValueEx(hKey, _T("Advanced"), 0, REG_DWORD, (LPBYTE)&Settings.IsAdvancedView, (DWORD) sizeof(DWORD));
136 
137  RegCloseKey(hKey);
138  }
139 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HWND hWnd
Definition: settings.c:17
#define ComboBox_GetText(hwndCtl, lpch, cchMax)
Definition: windowsx.h:33
SSSTARS Settings
Definition: settings.c:33
#define IDC_COMBO_CHARSET
Definition: resource.h:21
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
const TCHAR g_szGeneralRegKey[]
Definition: settings.c:16
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_FONTCOMBO
Definition: resource.h:12
HWND hCharmapDlg
Definition: charmap.c:22
#define REG_DWORD
Definition: sdbapi.c:596
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501
#define REG_SZ
Definition: layer.c:22

Referenced by _tWinMain(), MainDialogProc(), ScreenSaverConfigureDialog(), and wWinMain().

Variable Documentation

◆ Settings