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
)
33 TCHAR Buffer
[LINE_LEN
];
36 if (SetupGetStringField(&Context
, 0, Buffer
, sizeof(Buffer
) / sizeof(TCHAR
), NULL
) &&
37 SetupGetIntField(&Context
, 1, &ci
))
39 _stprintf(Desc
, _T("%s (%d DPI)"), Buffer
, ci
);
40 i
= SendMessage(hFontSize
, CB_ADDSTRING
, 0, (LPARAM
)Desc
);
42 SendMessage(hFontSize
, CB_SETITEMDATA
, (WPARAM
)i
, (LPARAM
)ci
);
47 if (RegQueryValueEx(hKey
, _T("LogPixels"), NULL
,
48 &dwType
, (LPBYTE
)&dwValue
, &dwSize
) == ERROR_SUCCESS
)
50 if ((int)dwValue
== ci
)
52 SendMessage(hFontSize
, CB_SETCURSEL
, (WPARAM
)i
, 0);
53 SetWindowText(GetDlgItem(hWnd
, IDC_FONTSIZE_CUSTOM
), Desc
);
58 if (!SetupFindNextLine(&Context
, &Context
))
67 SetupCloseInfFile(hInf
);
71 InitRadioButtons(HWND hWnd
)
75 if (RegOpenKeyEx(HKEY_CURRENT_USER
,
76 _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Controls Folder\\Display"),
77 0, KEY_READ
, &hKey
) == ERROR_SUCCESS
)
82 if (RegQueryValueEx(hKey
, _T("DynaSettingsChange"), 0, NULL
,
83 (LPBYTE
)szBuf
, &dwSize
) == ERROR_SUCCESS
)
88 SendDlgItemMessage(hWnd
, IDC_RESTART_RB
, BM_SETCHECK
, 1, 1);
91 SendDlgItemMessage(hWnd
, IDC_WITHOUTREBOOT_RB
, BM_SETCHECK
, 1, 1);
94 SendDlgItemMessage(hWnd
, IDC_ASKME_RB
, BM_SETCHECK
, 1, 1);
104 AdvGeneralPageProc(HWND hwndDlg
,
109 PDISPLAY_DEVICE_ENTRY DispDevice
= NULL
;
112 if (uMsg
!= WM_INITDIALOG
)
113 DispDevice
= (PDISPLAY_DEVICE_ENTRY
)GetWindowLongPtr(hwndDlg
, DWLP_USER
);
118 DispDevice
= (PDISPLAY_DEVICE_ENTRY
)(((LPPROPSHEETPAGE
)lParam
)->lParam
);
119 SetWindowLongPtr(hwndDlg
, DWLP_USER
, (LONG_PTR
)DispDevice
);
121 InitFontSizeList(hwndDlg
);
122 InitRadioButtons(hwndDlg
);
127 switch (LOWORD(wParam
))
129 case IDC_FONTSIZE_COMBO
:
130 if (HIWORD(wParam
) == CBN_SELCHANGE
)
132 PropSheet_Changed(GetParent(hwndDlg
), hwndDlg
);
136 case IDC_WITHOUTREBOOT_RB
:
138 PropSheet_Changed(GetParent(hwndDlg
), hwndDlg
);