PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0);
DlgSequenceNext();
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:      SetWindowText(hDlg, diSetupType.szTitle);      hDestinationPath = GetDlgItem(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */      TruncateString(hDestinationPath, szTempSetupPath, MAX_BUF, 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, (dwScreenX/2)-(rDlg.right/2), (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);      break;    case WM_COMMAND:      switch(LOWORD(wParam))      {/*        BROWSEINFO    biBrowseInfo;        LPITEMIDLIST  lppidlPath;        int           iImageId = 0;        char          szDisplayName[MAX_BUF];*/        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;/*          biBrowseInfo.hwndOwner        = hDlg;          biBrowseInfo.pidlRoot         = NULL;          biBrowseInfo.pszDisplayName   = szDisplayName;          biBrowseInfo.lpszTitle        = "Title of BrowseForFolder()";          biBrowseInfo.ulFlags          = BIF_EDITBOX |                                          BIF_STATUSTEXT |                                          BIF_DONTGOBELOWDOMAIN;          biBrowseInfo.lpfn             = NULL;          biBrowseInfo.lParam           = 0;          biBrowseInfo.iImage           = iImageId;          lppidlPath = SHBrowseForFolder(&biBrowseInfo);*/          BrowseForDirectory(hDlg, szTempSetupPath);          hDestinationPath = GetDlgItem(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */          TruncateString(hDestinationPath, szTempSetupPath, MAX_BUF, 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);          /* check for legacy file.  We're trying not to install over an old incompatible version */          if(CheckLegacy(hDlg) == TRUE)          {            SetForegroundWindow(hDlg);            break;          }          /* 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];            NS_LoadString(hSetupRscInst, IDS_STR_CREATE_DIRECTORY, szStrCreateDirectory, MAX_BUF);            if(NS_LoadString(hSetupRscInst, IDS_MSG_CREATE_DIRECTORY, szMsgCreateDirectory, MAX_BUF) == WIZ_OK)            {              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(NS_LoadString(hSetupRscInst, IDS_ERROR_CREATE_DIRECTORY, szECreateDirectory, MAX_BUF) == WIZ_OK)                  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);              }              bCreateDestinationDir = TRUE;            }            else            {              break;            }          }          /* retrieve and save the state of the selected radio button */          if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST0)      == BST_CHECKED)          {            if(dwSetupType != ST_RADIO0)              SiCNodeSetItemsSelected(ST_RADIO0);            dwSetupType     = ST_RADIO0;            dwTempSetupType = dwSetupType;          }          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST1) == BST_CHECKED)          {            if(dwSetupType != ST_RADIO1)              SiCNodeSetItemsSelected(ST_RADIO1);            dwSetupType     = ST_RADIO1;            dwTempSetupType = dwSetupType;          }          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST2) == BST_CHECKED)          {            if(dwSetupType != ST_RADIO2)              SiCNodeSetItemsSelected(ST_RADIO2);            dwSetupType     = ST_RADIO2;            dwTempSetupType = dwSetupType;          }          else if(IsDlgButtonChecked(hDlg, IDC_RADIO_ST3) == BST_CHECKED)          {            if(dwSetupType != ST_RADIO3)              SiCNodeSetItemsSelected(ST_RADIO3);            dwSetupType     = ST_RADIO3;            dwTempSetupType = dwSetupType;          }          /* set the next dialog to be shown depending on the              what the user selected */          dwWizardState = DLG_SETUP_TYPE;          CheckWizardStateCustom(DLG_ADVANCED_SETTINGS);          DestroyWindow(hDlg);          PostMessage(hWndMain, WM_COMMAND, IDWIZNEXT, 0);          break;        case IDWIZBACK:          dwTempSetupType = dwSetupType;          lstrcpy(szTempSetupPath, sgProduct.szPath);          DestroyWindow(hDlg);          PostMessage(hWndMain, WM_COMMAND, IDWIZBACK, 0);          break;        case IDCANCEL:          lstrcpy(sgProduct.szPath, szTempSetupPath);          AskCancelDlg(hDlg);          break;        default:          break;      }      break;  }  return(0);}