switch(diDownloadOptions.dwUseProtocol) { case UP_HTTP: CheckDlgButton(hDlg, IDC_USE_FTP,  BST_UNCHECKED); CheckDlgButton(hDlg, IDC_USE_HTTP, BST_CHECKED); break;  case UP_FTP: default: CheckDlgButton(hDlg, IDC_USE_FTP,  BST_CHECKED); CheckDlgButton(hDlg, IDC_USE_HTTP, BST_UNCHECKED); break;  }  if((diDownloadOptions.bShowProtocols) && (diDownloadOptions.bUseProtocolSettings)) { ShowWindow(GetDlgItem(hDlg, IDC_USE_FTP),  SW_SHOW); ShowWindow(GetDlgItem(hDlg, IDC_USE_HTTP), SW_SHOW); } else { ShowWindow(GetDlgItem(hDlg, IDC_USE_FTP),  SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDC_USE_HTTP), SW_HIDE); }
LRESULT CALLBACK DlgProcDownloadOptions(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam){  RECT  rDlg;  char  szBuf[MAX_BUF];  HWND  hwndCBSiteSelector;  int   iIndex;  ssi   *ssiTemp;  char  szCBDefault[MAX_BUF];  hwndCBSiteSelector = GetDlgItem(hDlg, IDC_LIST_SITE_SELECTOR);  switch(msg)  {    case WM_INITDIALOG:      DisableSystemMenuItems(hDlg, FALSE);      SetWindowText(hDlg, diDownloadOptions.szTitle);      SetDlgItemText(hDlg, IDC_MESSAGE0, diDownloadOptions.szMessage0);      SetDlgItemText(hDlg, IDC_MESSAGE1, diDownloadOptions.szMessage1);      GetPrivateProfileString("Strings", "IDC Use Ftp", "", szBuf, sizeof(szBuf), szFileIniConfig);      SetDlgItemText(hDlg, IDC_USE_FTP, szBuf);      GetPrivateProfileString("Strings", "IDC Use Http", "", szBuf, sizeof(szBuf), szFileIniConfig);      SetDlgItemText(hDlg, IDC_USE_HTTP, szBuf);      GetPrivateProfileString("Strings", "IDC Save Installer Files", "", szBuf, sizeof(szBuf), szFileIniConfig);      SetDlgItemText(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, szBuf);      GetSaveInstallerPath(szBuf, sizeof(szBuf));      SetDlgItemText(hDlg, IDC_EDIT_LOCAL_INSTALLER_PATH, szBuf);      SetDlgItemText(hDlg, IDC_BUTTON_PROXY_SETTINGS, sgInstallGui.szProxySettings_);      SetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);      SetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);      SetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);      SendDlgItemMessage (hDlg, IDC_BUTTON_PROXY_SETTINGS, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDWIZBACK, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDWIZNEXT, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDC_LIST_SITE_SELECTOR, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDC_MESSAGE1, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDC_EDIT_LOCAL_INSTALLER_PATH, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDC_USE_FTP, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      SendDlgItemMessage (hDlg, IDC_USE_HTTP, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);      if(GetClientRect(hDlg, &rDlg))        SetWindowPos(hDlg,                     HWND_TOP,                     (gSystemInfo.dwScreenX/2)-(rDlg.right/2),                     (gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),                     0,                     0,                     SWP_NOSIZE);      ssiTemp = ssiSiteSelector;      do      {        if(ssiTemp == NULL)          break;        SendMessage(hwndCBSiteSelector, CB_ADDSTRING, 0, (LPARAM)(ssiTemp->szDescription));        ssiTemp = ssiTemp->Next;      } while(ssiTemp != ssiSiteSelector);      if((szSiteSelectorDescription == NULL) || (*szSiteSelectorDescription == '\0'))      {          if(GetPrivateProfileString("Messages", "CB_DEFAULT", "", szCBDefault, sizeof(szCBDefault), szFileIniInstall) &&          ((iIndex = SendMessage(hwndCBSiteSelector, CB_SELECTSTRING, -1, (LPARAM)szCBDefault)) != CB_ERR))          SendMessage(hwndCBSiteSelector, CB_SETCURSEL, (WPARAM)iIndex, 0);        else          SendMessage(hwndCBSiteSelector, CB_SETCURSEL, 0, 0);      }      else if((iIndex = SendMessage(hwndCBSiteSelector, CB_SELECTSTRING, -1, (LPARAM)szSiteSelectorDescription)) != CB_ERR)        SendMessage(hwndCBSiteSelector, CB_SETCURSEL, (WPARAM)iIndex, 0);      else        SendMessage(hwndCBSiteSelector, CB_SETCURSEL, 0, 0);      if(diDownloadOptions.bSaveInstaller)        CheckDlgButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, BST_CHECKED);      else        CheckDlgButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, BST_UNCHECKED);      switch(diDownloadOptions.dwUseProtocol)      {        case UP_HTTP:          CheckDlgButton(hDlg, IDC_USE_FTP,  BST_UNCHECKED);          CheckDlgButton(hDlg, IDC_USE_HTTP, BST_CHECKED);          break;        case UP_FTP:        default:          CheckDlgButton(hDlg, IDC_USE_FTP,  BST_CHECKED);          CheckDlgButton(hDlg, IDC_USE_HTTP, BST_UNCHECKED);          break;      }      if((diDownloadOptions.bShowProtocols) && (diDownloadOptions.bUseProtocolSettings))      {        ShowWindow(GetDlgItem(hDlg, IDC_USE_FTP),  SW_SHOW);        ShowWindow(GetDlgItem(hDlg, IDC_USE_HTTP), SW_SHOW);      }      else      {        ShowWindow(GetDlgItem(hDlg, IDC_USE_FTP),  SW_HIDE);        ShowWindow(GetDlgItem(hDlg, IDC_USE_HTTP), SW_HIDE);      }      break;    case WM_COMMAND:      switch(LOWORD(wParam))      {        case IDWIZNEXT:          SaveDownloadOptions(hDlg, hwndCBSiteSelector);          DestroyWindow(hDlg);          DlgSequenceNext();          break;        case IDWIZBACK:          SaveDownloadOptions(hDlg, hwndCBSiteSelector);          DestroyWindow(hDlg);          DlgSequencePrev();          break;        case IDC_BUTTON_ADDITIONAL_SETTINGS:          SaveDownloadOptions(hDlg, hwndCBSiteSelector);          dwWizardState = DLG_PROGRAM_FOLDER;          DestroyWindow(hDlg);          DlgSequenceNext();          break;        case IDCANCEL:          AskCancelDlg(hDlg);          break;        default:          break;      }      break;  }  return(0);}