ReactOS  0.4.14-dev-614-gbfd8a84
general.c File Reference
#include "desk.h"
Include dependency graph for general.c:

Go to the source code of this file.

Functions

static VOID InitFontSizeList (HWND hWnd)
 
static VOID InitRadioButtons (HWND hWnd)
 
INT_PTR CALLBACK AdvGeneralPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ AdvGeneralPageProc()

INT_PTR CALLBACK AdvGeneralPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 115 of file general.c.

119 {
120  PDISPLAY_DEVICE_ENTRY DispDevice = NULL;
121  INT_PTR Ret = 0;
122 
123  if (uMsg != WM_INITDIALOG)
124  DispDevice = (PDISPLAY_DEVICE_ENTRY)GetWindowLongPtr(hwndDlg, DWLP_USER);
125 
126  switch (uMsg)
127  {
128  case WM_INITDIALOG:
130  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)DispDevice);
131 
132  InitFontSizeList(hwndDlg);
133  InitRadioButtons(hwndDlg);
134 
135  Ret = TRUE;
136  break;
137  case WM_COMMAND:
138  switch (LOWORD(wParam))
139  {
140  case IDC_FONTSIZE_COMBO:
141  if (HIWORD(wParam) == CBN_SELCHANGE)
142  {
143  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
144  }
145  break;
146  case IDC_RESTART_RB:
148  case IDC_ASKME_RB:
149  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
150  break;
151  }
152  break;
153  }
154 
155  return Ret;
156 }
#define TRUE
Definition: types.h:120
Definition: precomp.h:67
int32_t INT_PTR
Definition: typedefs.h:62
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDC_FONTSIZE_COMBO
Definition: resource.h:172
static VOID InitFontSizeList(HWND hWnd)
Definition: general.c:11
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define IDC_RESTART_RB
Definition: resource.h:174
#define IDC_WITHOUTREBOOT_RB
Definition: resource.h:175
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
struct _DISPLAY_DEVICE_ENTRY * PDISPLAY_DEVICE_ENTRY
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
HWND WINAPI GetParent(_In_ HWND)
static VOID InitRadioButtons(HWND hWnd)
Definition: general.c:78
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDC_ASKME_RB
Definition: resource.h:176
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by DisplayAdvancedSettings().

◆ InitFontSizeList()

static VOID InitFontSizeList ( HWND  hWnd)
static

Definition at line 11 of file general.c.

12 {
13  HINF hInf;
14  HKEY hKey;
15  HWND hFontSize;
17  int i, ci = 0;
18  DWORD dwSize, dwValue, dwType;
19 
20  hFontSize = GetDlgItem(hWnd, IDC_FONTSIZE_COMBO);
21 
22  hInf = SetupOpenInfFile(_T("font.inf"), NULL,
24 
25  if (hInf != INVALID_HANDLE_VALUE)
26  {
27  if (SetupFindFirstLine(hInf, _T("Font Sizes"), NULL, &Context))
28  {
29  if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts"),
30  0, KEY_READ, &hKey) == ERROR_SUCCESS)
31  {
32  dwSize = MAX_PATH;
33  dwType = REG_DWORD;
34 
35  if (RegQueryValueEx(hKey, _T("LogPixels"), NULL, &dwType,
36  (LPBYTE)&dwValue, &dwSize) != ERROR_SUCCESS)
37  {
38  dwValue = 0;
39  }
40 
41  RegCloseKey(hKey);
42  }
43 
44  for (;;)
45  {
47  TCHAR Desc[LINE_LEN];
48 
49  if (SetupGetStringField(&Context, 0, Buffer, sizeof(Buffer) / sizeof(TCHAR), NULL) &&
50  SetupGetIntField(&Context, 1, &ci))
51  {
52  _stprintf(Desc, _T("%s (%d DPI)"), Buffer, ci);
53  i = SendMessage(hFontSize, CB_ADDSTRING, 0, (LPARAM)Desc);
54  if (i != CB_ERR)
55  SendMessage(hFontSize, CB_SETITEMDATA, (WPARAM)i, (LPARAM)ci);
56 
57  if ((int)dwValue == ci)
58  {
59  SendMessage(hFontSize, CB_SETCURSEL, (WPARAM)i, 0);
61  }
62  else
63  SendMessage(hFontSize, CB_SETCURSEL, 0, 0);
64  }
65 
67  {
68  break;
69  }
70  }
71  }
72  }
73 
74  SetupCloseInfFile(hInf);
75 }
#define RegQueryValueEx
Definition: winreg.h:524
#define CB_SETITEMDATA
Definition: winuser.h:1948
#define INF_STYLE_WIN4
Definition: infsupp.h:41
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SetupFindFirstLine
Definition: setupapi.h:2619
#define KEY_READ
Definition: nt_native.h:1023
HWND hWnd
Definition: settings.c:17
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
UINT_PTR WPARAM
Definition: windef.h:207
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
#define IDC_FONTSIZE_COMBO
Definition: resource.h:172
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define CB_ADDSTRING
Definition: winuser.h:1918
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
Definition: bufpool.h:45
#define CB_ERR
Definition: winuser.h:2410
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LINE_LEN
Definition: setupapi.h:20
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetupGetStringField
Definition: setupapi.h:2634
#define CB_SETCURSEL
Definition: winuser.h:1943
#define _stprintf
Definition: utility.h:124
#define RegOpenKeyEx
Definition: winreg.h:520
#define SetWindowText
Definition: winuser.h:5832
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.c:146
#define SendMessage
Definition: winuser.h:5818
struct tagContext Context
Definition: acpixf.h:1030
#define REG_DWORD
Definition: sdbapi.c:596
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define SetupOpenInfFile
Definition: setupapi.h:2647
#define IDC_FONTSIZE_CUSTOM
Definition: resource.h:173
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by AdvGeneralPageProc().

◆ InitRadioButtons()

static VOID InitRadioButtons ( HWND  hWnd)
static

Definition at line 78 of file general.c.

79 {
80  HKEY hKey;
81 
83  _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Controls Folder\\Display"),
84  0, KEY_READ, &hKey) == ERROR_SUCCESS)
85  {
86  TCHAR szBuf[64];
87  DWORD dwSize = 64;
88 
89  if (RegQueryValueEx(hKey, _T("DynaSettingsChange"), 0, NULL,
90  (LPBYTE)szBuf, &dwSize) == ERROR_SUCCESS)
91  {
92  switch (_ttoi(szBuf))
93  {
94  case 0:
96  break;
97  case 1:
99  break;
100  case 3:
102  break;
103  }
104  }
105  else
107 
108  RegCloseKey(hKey);
109  }
110  else
112 }
#define RegQueryValueEx
Definition: winreg.h:524
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HWND hWnd
Definition: settings.c:17
#define SendDlgItemMessage
Definition: winuser.h:5817
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
#define IDC_RESTART_RB
Definition: resource.h:174
#define IDC_WITHOUTREBOOT_RB
Definition: resource.h:175
char TCHAR
Definition: xmlstorage.h:189
#define BM_SETCHECK
Definition: winuser.h:1903
#define _T(x)
Definition: vfdio.h:22
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RegOpenKeyEx
Definition: winreg.h:520
int CDECL _ttoi(const _TCHAR *str)
Definition: atoi.c:10
#define IDC_ASKME_RB
Definition: resource.h:176
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by AdvGeneralPageProc().