Index: dll/cpl/desk/general.c =================================================================== --- dll/cpl/desk/general.c (revision 63236) +++ dll/cpl/desk/general.c (working copy) @@ -28,6 +28,19 @@ { if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontDPI"), 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + dwSize = MAX_PATH; + dwType = REG_DWORD; + + if (!RegQueryValueEx(hKey, _T("LogPixels"), NULL, + &dwType, (LPBYTE)&dwValue, &dwSize) == ERROR_SUCCESS) + { + dwValue = 0; + } + + RegCloseKey(hKey); + } + for (;;) { TCHAR Buffer[LINE_LEN]; @@ -41,23 +54,17 @@ if (i != CB_ERR) SendMessage(hFontSize, CB_SETITEMDATA, (WPARAM)i, (LPARAM)ci); - dwSize = MAX_PATH; - dwType = REG_DWORD; - - if (RegQueryValueEx(hKey, _T("LogPixels"), NULL, - &dwType, (LPBYTE)&dwValue, &dwSize) == ERROR_SUCCESS) + if ((int)dwValue == ci) { - if ((int)dwValue == ci) - { - SendMessage(hFontSize, CB_SETCURSEL, (WPARAM)i, 0); - SetWindowText(GetDlgItem(hWnd, IDC_FONTSIZE_CUSTOM), Desc); - } + SendMessage(hFontSize, CB_SETCURSEL, (WPARAM)i, 0); + SetWindowText(GetDlgItem(hWnd, IDC_FONTSIZE_CUSTOM), Desc); } + else + SendMessage(hFontSize, CB_SETCURSEL, 0, 0); } if (!SetupFindNextLine(&Context, &Context)) { - RegCloseKey(hKey); break; } }