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
, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Controls Folder\\Display"),
75 0, KEY_READ
, &hKey
) == ERROR_SUCCESS
)
80 if (RegQueryValueEx(hKey
, _T("DynaSettingsChange"), 0, NULL
,
81 (LPBYTE
)szBuf
, &dwSize
) == ERROR_SUCCESS
);
86 SendDlgItemMessage(hWnd
, IDC_RESTART_RB
, BM_SETCHECK
, 1, 1);
89 SendDlgItemMessage(hWnd
, IDC_WITHOUTREBOOT_RB
, BM_SETCHECK
, 1, 1);
92 SendDlgItemMessage(hWnd
, IDC_ASKME_RB
, BM_SETCHECK
, 1, 1);
101 AdvGeneralPageProc(HWND hwndDlg
,
106 PDISPLAY_DEVICE_ENTRY DispDevice
= NULL
;
109 if (uMsg
!= WM_INITDIALOG
)
110 DispDevice
= (PDISPLAY_DEVICE_ENTRY
)GetWindowLongPtr(hwndDlg
, DWLP_USER
);
115 DispDevice
= (PDISPLAY_DEVICE_ENTRY
)(((LPPROPSHEETPAGE
)lParam
)->lParam
);
116 SetWindowLongPtr(hwndDlg
, DWLP_USER
, (LONG_PTR
)DispDevice
);
118 InitFontSizeList(hwndDlg
);
119 InitRadioButtons(hwndDlg
);
124 switch (LOWORD(wParam
))
126 case IDC_FONTSIZE_COMBO
:
127 if (HIWORD(wParam
) == CBN_SELCHANGE
)
129 PropSheet_Changed(GetParent(hwndDlg
), hwndDlg
);
133 case IDC_WITHOUTREBOOT_RB
:
135 PropSheet_Changed(GetParent(hwndDlg
), hwndDlg
);