DlgSequencePrev();
DlgSequence(PREV_DLG);
LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam){  HWND          hRadioSt0;  HWND          hStaticSt0;  HWND          hRadioSt1;  HWND          hStaticSt1;  HWND          hRadioSt2;  HWND          hStaticSt2;  HWND          hRadioSt3;  HWND          hStaticSt3;  HWND          hReadme;  HWND          hDestinationPath;  RECT          rDlg;  char          szBuf[MAX_BUF];  char          szBufTemp[MAX_BUF];  char          szBufTemp2[MAX_BUF];  hRadioSt0   = GetDlgItem(hDlg, IDC_RADIO_ST0);  hStaticSt0  = GetDlgItem(hDlg, IDC_STATIC_ST0_DESCRIPTION);  hRadioSt1   = GetDlgItem(hDlg, IDC_RADIO_ST1);  hStaticSt1  = GetDlgItem(hDlg, IDC_STATIC_ST1_DESCRIPTION);  hRadioSt2   = GetDlgItem(hDlg, IDC_RADIO_ST2);  hStaticSt2  = GetDlgItem(hDlg, IDC_STATIC_ST2_DESCRIPTION);  hRadioSt3   = GetDlgItem(hDlg, IDC_RADIO_ST3);  hStaticSt3  = GetDlgItem(hDlg, IDC_STATIC_ST3_DESCRIPTION);  hReadme     = GetDlgItem(hDlg, IDC_README);  switch(msg)  {    case WM_INITDIALOG:      DisableSystemMenuItems(hDlg, FALSE);      SetWindowText(hDlg, diSetupType.szTitle);      hDestinationPath = GetDlgItem(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */      TruncateString(hDestinationPath, szTempSetupPath, szBuf, sizeof(szBuf));      SetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szBuf);      SetDlgItemText(hDlg, IDC_STATIC_MSG0, diSetupType.szMessage0);      if(diSetupType.stSetupType0.bVisible)      {        SetDlgItemText(hDlg, IDC_RADIO_ST0, diSetupType.stSetupType0.szDescriptionShort);        SetDlgItemText(hDlg, IDC_STATIC_ST0_DESCRIPTION, diSetupType.stSetupType0.szDescriptionLong);        ShowWindow(hRadioSt0, SW_SHOW);        ShowWindow(hStaticSt0, SW_SHOW);      }      else      {        ShowWindow(hRadioSt0, SW_HIDE);        ShowWindow(hStaticSt0, SW_HIDE);      }      if(diSetupType.stSetupType1.bVisible)      {        SetDlgItemText(hDlg, IDC_RADIO_ST1, diSetupType.stSetupType1.szDescriptionShort);        SetDlgItemText(hDlg, IDC_STATIC_ST1_DESCRIPTION, diSetupType.stSetupType1.szDescriptionLong);        ShowWindow(hRadioSt1, SW_SHOW);        ShowWindow(hStaticSt1, SW_SHOW);      }      else      {        ShowWindow(hRadioSt1, SW_HIDE);        ShowWindow(hStaticSt1, SW_HIDE);      }      if(diSetupType.stSetupType2.bVisible)      {        SetDlgItemText(hDlg, IDC_RADIO_ST2, diSetupType.stSetupType2.szDescriptionShort);        SetDlgItemText(hDlg, IDC_STATIC_ST2_DESCRIPTION, diSetupType.stSetupType2.szDescriptionLong);        ShowWindow(hRadioSt2, SW_SHOW);        ShowWindow(hStaticSt2, SW_SHOW);      }      else      {        ShowWindow(hRadioSt2, SW_HIDE);        ShowWindow(hStaticSt2, SW_HIDE);      }      if(diSetupType.stSetupType3.bVisible)      {        SetDlgItemText(hDlg, IDC_RADIO_ST3, diSetupType.stSetupType3.szDescriptionShort);        SetDlgItemText(hDlg, IDC_STATIC_ST3_DESCRIPTION, diSetupType.stSetupType3.szDescriptionLong);        ShowWindow(hRadioSt3, SW_SHOW);        ShowWindow(hStaticSt3, SW_SHOW);      }      else      {        ShowWindow(hRadioSt3, SW_HIDE);        ShowWindow(hStaticSt3, SW_HIDE);      }      /* enable the appropriate radio button */      switch(dwTempSetupType)      {        case ST_RADIO0:          CheckDlgButton(hDlg, IDC_RADIO_ST0, BST_CHECKED);          SetFocus(hRadioSt0);          break;        case ST_RADIO1:          CheckDlgButton(hDlg, IDC_RADIO_ST1, BST_CHECKED);          SetFocus(hRadioSt1);          break;        case ST_RADIO2:          CheckDlgButton(hDlg, IDC_RADIO_ST2, BST_CHECKED);          SetFocus(hRadioSt2);          break;        case ST_RADIO3:          CheckDlgButton(hDlg, IDC_RADIO_ST3, BST_CHECKED);          SetFocus(hRadioSt3);          break;      }      if(GetClientRect(hDlg, &rDlg))        SetWindowPos(hDlg,                     HWND_TOP,                     (gSystemInfo.dwScreenX/2)-(rDlg.right/2),                     (gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),                     0,                     0,                     SWP_NOSIZE);      if((*diSetupType.szReadmeFilename == '\0') || (FileExists(diSetupType.szReadmeFilename) == FALSE))        ShowWindow(hReadme, SW_HIDE);      else        ShowWindow(hReadme, SW_SHOW);      SetDlgItemText(hDlg, IDC_DESTINATION, sgInstallGui.szDestinationDirectory);      SetDlgItemText(hDlg, IDC_BUTTON_BROWSE, sgInstallGui.szBrowse_);      SetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);      SetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);      SetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);      SetDlgItemText(hDlg, IDC_README, sgInstallGui.szReadme_);      SendDlgItemMessage (hDlg, IDC_STATIC_MSG0, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_RADIO_ST0, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_RADIO_ST1, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_RADIO_ST2, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_RADIO_ST3, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC_ST0_DESCRIPTION, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC_ST1_DESCRIPTION, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC_ST2_DESCRIPTION, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC_ST3_DESCRIPTION, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_EDIT_DESTINATION, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L);      SendDlgItemMessage (hDlg, IDC_BUTTON_BROWSE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDWIZBACK, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDWIZNEXT, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_README, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      if(sgProduct.bLockPath)        EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_BROWSE), FALSE);      else        EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_BROWSE), TRUE);      break;    case WM_COMMAND:      switch(LOWORD(wParam))      {        case IDC_BUTTON_BROWSE:          if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST0)      == BST_CHECKED)            dwTempSetupType = ST_RADIO0;          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST1) == BST_CHECKED)            dwTempSetupType = ST_RADIO1;          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST2) == BST_CHECKED)            dwTempSetupType = ST_RADIO2;          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST3) == BST_CHECKED)            dwTempSetupType = ST_RADIO3;          BrowseForDirectory(hDlg, szTempSetupPath);          hDestinationPath = GetDlgItem(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */          TruncateString(hDestinationPath, szTempSetupPath, szBuf, sizeof(szBuf));          SetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szBuf);          break;        case IDC_README:          if(*diSetupType.szReadmeApp == '\0')            WinSpawn(diSetupType.szReadmeFilename, NULL, szSetupDir, SW_SHOWNORMAL, FALSE);          else            WinSpawn(diSetupType.szReadmeApp, diSetupType.szReadmeFilename, szSetupDir, SW_SHOWNORMAL, FALSE);          break;        case IDWIZNEXT:          lstrcpy(sgProduct.szPath, szTempSetupPath);          /* append a backslash to the path because CreateDirectoriesAll()             uses a backslash to determine directories */          lstrcpy(szBuf, sgProduct.szPath);          AppendBackSlash(szBuf, sizeof(szBuf));          if(FileExists(szBuf) == FALSE)          {            char szMsgCreateDirectory[MAX_BUF];            char szStrCreateDirectory[MAX_BUF];            GetPrivateProfileString("Messages", "STR_CREATE_DIRECTORY", "", szStrCreateDirectory, sizeof(szStrCreateDirectory), szFileIniInstall);            if(GetPrivateProfileString("Messages", "MSG_CREATE_DIRECTORY", "", szMsgCreateDirectory, sizeof(szMsgCreateDirectory), szFileIniInstall))            {              lstrcpy(szBufTemp, "\n\n");              lstrcat(szBufTemp, szBuf);              RemoveBackSlash(szBufTemp);              lstrcat(szBufTemp, "\n\n");              wsprintf(szBufTemp2, szMsgCreateDirectory, szBufTemp);            }            if(MessageBox(hDlg, szBufTemp2, szStrCreateDirectory, MB_YESNO | MB_ICONQUESTION) == IDYES)            {              char szBuf2[MAX_PATH];              if(CreateDirectoriesAll(szBuf, TRUE) == FALSE)              {                char szECreateDirectory[MAX_BUF];                lstrcpy(szBufTemp, "\n\n");                lstrcat(szBufTemp, sgProduct.szPath);                RemoveBackSlash(szBufTemp);                lstrcat(szBufTemp, "\n\n");                if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall))                  wsprintf(szBuf, szECreateDirectory, szBufTemp);                MessageBox(hDlg, szBuf, "", MB_OK | MB_ICONERROR);                break;              }              if(*sgProduct.szSubPath != '\0')              {                 /* log the subpath for uninstallation.  This subpath does not normally get logged                  * for uninstallation due to a chicken and egg problem with creating the log file                  * and the directory its in */                lstrcpy(szBuf2, szBuf);                AppendBackSlash(szBuf2, sizeof(szBuf2));                lstrcat(szBuf2, sgProduct.szSubPath);                UpdateInstallLog(KEY_CREATE_FOLDER, szBuf2, FALSE);              }              bCreateDestinationDir = TRUE;            }            else            {              break;            }          }          /* retrieve and save the state of the selected radio button */          if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST0)      == BST_CHECKED)          {            SiCNodeSetItemsSelected(ST_RADIO0);            dwSetupType     = ST_RADIO0;            dwTempSetupType = dwSetupType;          }          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST1) == BST_CHECKED)          {            SiCNodeSetItemsSelected(ST_RADIO1);            dwSetupType     = ST_RADIO1;            dwTempSetupType = dwSetupType;          }          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST2) == BST_CHECKED)          {            SiCNodeSetItemsSelected(ST_RADIO2);            dwSetupType     = ST_RADIO2;            dwTempSetupType = dwSetupType;          }          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST3) == BST_CHECKED)          {            SiCNodeSetItemsSelected(ST_RADIO3);            dwSetupType     = ST_RADIO3;            dwTempSetupType = dwSetupType;          }          DestroyWindow(hDlg);          DlgSequenceNext();          break;        case IDWIZBACK:          dwTempSetupType = dwSetupType;          lstrcpy(szTempSetupPath, sgProduct.szPath);          DestroyWindow(hDlg);          DlgSequencePrev();          break;        case IDCANCEL:          lstrcpy(sgProduct.szPath, szTempSetupPath);          AskCancelDlg(hDlg);          break;        default:          break;      }      break;  }  return(0);}