2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Display Control Panel
4 * FILE: dll/cpl/desk/general.c
5 * PURPOSE: Advanced General settings
11 InitFontSizeList(HWND hWnd
)
18 DWORD dwSize
, dwValue
, dwType
;
20 hFontSize
= GetDlgItem(hWnd
, IDC_FONTSIZE_COMBO
);
22 hInf
= SetupOpenInfFile(_T("font.inf"), NULL
,
23 INF_STYLE_WIN4
, NULL
);
25 if (hInf
!= INVALID_HANDLE_VALUE
)
27 if (SetupFindFirstLine(hInf
, _T("Font Sizes"), NULL
, &Context
))
29 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE
, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontDPI"),
30 0, KEY_READ
, &hKey
) == ERROR_SUCCESS
)
35 if (SetupGetStringField(&Context
, 0, Desc
, sizeof(Desc
), NULL
) &&
36 SetupGetIntField(&Context
, 1, &ci
))
38 _stprintf(Desc
, _T("%s (%d DPI)"), Desc
, ci
);
39 i
= SendMessage(hFontSize
, CB_ADDSTRING
, 0, (LPARAM
)Desc
);
41 SendMessage(hFontSize
, CB_SETITEMDATA
, (WPARAM
)i
, (LPARAM
)ci
);
46 if (RegQueryValueEx(hKey
, _T("LogPixels"), NULL
,
47 &dwType
, (LPBYTE
)&dwValue
, &dwSize
) == ERROR_SUCCESS
)
49 if ((int)dwValue
== ci
)
51 SendMessage(hFontSize
, CB_SETCURSEL
, (WPARAM
)i
, 0);
52 SetWindowText(GetDlgItem(hWnd
, IDC_FONTSIZE_COSTOM
), Desc
);
57 if (!SetupFindNextLine(&Context
, &Context
))
66 SetupCloseInfFile(hInf
);
70 InitRadioButtons(HWND hWnd
)
74 if (RegOpenKeyEx(HKEY_CURRENT_USER
,
75 _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Controls Folder\\Display"),
76 0, KEY_READ
, &hKey
) == ERROR_SUCCESS
)
81 if (RegQueryValueEx(hKey
, _T("DynaSettingsChange"), 0, NULL
,
82 (LPBYTE
)szBuf
, &dwSize
) == ERROR_SUCCESS
)
87 SendDlgItemMessage(hWnd
, IDC_RESTART_RB
, BM_SETCHECK
, 1, 1);
90 SendDlgItemMessage(hWnd
, IDC_WITHOUTREBOOT_RB
, BM_SETCHECK
, 1, 1);
93 SendDlgItemMessage(hWnd
, IDC_ASKME_RB
, BM_SETCHECK
, 1, 1);
103 AdvGeneralPageProc(HWND hwndDlg
,
108 PDISPLAY_DEVICE_ENTRY DispDevice
= NULL
;
111 if (uMsg
!= WM_INITDIALOG
)
112 DispDevice
= (PDISPLAY_DEVICE_ENTRY
)GetWindowLongPtr(hwndDlg
, DWLP_USER
);
117 DispDevice
= (PDISPLAY_DEVICE_ENTRY
)(((LPPROPSHEETPAGE
)lParam
)->lParam
);
118 SetWindowLongPtr(hwndDlg
, DWLP_USER
, (LONG_PTR
)DispDevice
);
120 InitFontSizeList(hwndDlg
);
121 InitRadioButtons(hwndDlg
);
126 switch (LOWORD(wParam
))
128 case IDC_FONTSIZE_COMBO
:
129 if (HIWORD(wParam
) == CBN_SELCHANGE
)
131 PropSheet_Changed(GetParent(hwndDlg
), hwndDlg
);
135 case IDC_WITHOUTREBOOT_RB
:
137 PropSheet_Changed(GetParent(hwndDlg
), hwndDlg
);