Back to index

lightning-sunbird  0.9+nobinonly
Functions
dialogs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

LRESULT CALLBACK DlgProcMain (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
MRESULT EXPENTRY DlgProcWelcome (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY DlgProcLicense (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY DlgProcSetupType (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY DlgProcSelectComponents (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY DlgProcSelectAdditionalComponents (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY DlgProcOS2Integration (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY DlgProcAdditionalOptions (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY DlgProcAdvancedSettings (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
LRESULT CALLBACK DlgProcQuickLaunch (HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
LRESULT CALLBACK DlgProcSiteSelector (HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
MRESULT EXPENTRY DlgProcStartInstall (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT CALLBACK DlgProcReboot (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY DlgProcMessage (HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
MRESULT EXPENTRY NewListBoxWndProc (HWND, ULONG, MPARAM, MPARAM)
LRESULT CALLBACK DlgProcUpgrade (HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
void ToggleCheck (HWND hwndListBox, DWORD dwIndex, DWORD dwACFlag)
BOOL AskCancelDlg (HWND hDlg)
void lbAddItem (HWND hList, siC *siCComponent)
HWND InstantiateDialog (HWND hParent, ULONG ulDlgID, PSZ szTitle, PFNWP pfnwpDlgProc)
void DlgSequence (int iDirection)
void PaintGradientShade (HWND hWnd, HDC hdc)
BOOL BrowseForDirectory (HWND hDlg, char *szCurrDir)
LRESULT CALLBACK BrowseHookProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
void ShowMessage (PSZ szMessage, BOOL bShow)
void DrawLBText (LPDRAWITEMSTRUCT lpdis, DWORD dwACFlag)
void DrawCheck (LPDRAWITEMSTRUCT lpdis, DWORD dwACFlag)
void InvalidateLBCheckbox (HWND hwndListBox)
void ProcessWindowsMessages (void)
LPSTR GetStartInstallMessage (void)
void AppendStringWOTilde (LPSTR szInputString, DWORD dwInputStringSize, LPSTR szString)
void TruncateString (HWND hWnd, LPSTR szInPath, LPSTR szOutPath, DWORD dwOutPathBufSize)
void SaveAdditionalOptions (HWND hDlg, HWND hwndCBSiteSelector)
WNDPROC SubclassWindow (HWND hWnd, WNDPROC NewWndProc)
LRESULT CALLBACK ListBoxBrowseWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void DisableSystemMenuItems (HWND hWnd, BOOL bDisableClose)
void CommitInstall (void)
void AdjustDialogSize (HWND hwndDlg)

Function Documentation

void AdjustDialogSize ( HWND  hwndDlg)

Definition at line 95 of file dialogs.c.

{
  FONTMETRICS fm;
  HPS hps;
  float duX, duY;
  LONG cxDlgFrame, cyDlgFrame, cyTitleBar;
  SWP swpCurrent, swpDlg;
  HENUM henum;
  HWND hwndNext;
  USHORT id;
  CHAR classname[4];

  hps = WinGetPS(hwndDlg);
  GpiQueryFontMetrics(hps, sizeof(FONTMETRICS), &fm);
  WinReleasePS(hps);
  duX = fm.lAveCharWidth*0.25;
  duY = fm.lMaxBaselineExt*0.125;
  cxDlgFrame = WinQuerySysValue(HWND_DESKTOP, SV_CXDLGFRAME);
  cyDlgFrame = WinQuerySysValue(HWND_DESKTOP, SV_CYDLGFRAME);
  cyTitleBar = WinQuerySysValue(HWND_DESKTOP, SV_CYTITLEBAR);

  WinQueryWindowPos(hwndDlg, &swpDlg);
  swpDlg.cx = ((swpDlg.cx-(cxDlgFrame*2))/duX)+(cxDlgFrame*2);
  swpDlg.cy = ((swpDlg.cy-cyTitleBar-(cyDlgFrame*2))/duY)+cyTitleBar+(cyDlgFrame*2);
  WinSetWindowPos(hwndDlg, 0, 0, 0,
                  swpDlg.cx,
                  swpDlg.cy,
                  SWP_SIZE);

  henum = WinBeginEnumWindows(hwndDlg);
  while ((hwndNext = WinGetNextWindow(henum)) != NULLHANDLE)
  {
    id = WinQueryWindowUShort( hwndNext, QWS_ID );
    if ((id == FID_TITLEBAR) ||
        (id == FID_SYSMENU) ||
        (id == FID_MINMAX) ||
        (id == FID_MENU))
    {
      continue;
    }
    WinQueryWindowPos(hwndNext, &swpCurrent);
    WinQueryClassName(hwndNext, 4, classname);
    if (strcmp(classname, "#6") == 0) {
      swpCurrent.x += 3;
      swpCurrent.y += 3;
      swpCurrent.cx -= 6;
      swpCurrent.cy -= 6;
      WinSetWindowPos(hwndNext, 0,
                      (swpCurrent.x-4)/duX+cyDlgFrame+3,
                      (swpCurrent.y-4)/duY+cyDlgFrame+3,
                      swpCurrent.cx/duX-6,
                      swpCurrent.cy/duY-6,
                      SWP_MOVE | SWP_SIZE);
    } else {
      WinSetWindowPos(hwndNext, 0,
                      (swpCurrent.x-4)/duX+cyDlgFrame,
                      (swpCurrent.y-4)/duY+cyDlgFrame,
                      swpCurrent.cx/duX,
                      swpCurrent.cy/duY,
                      SWP_MOVE | SWP_SIZE);
    }
  }
}

Here is the caller graph for this function:

void AppendStringWOTilde ( LPSTR  szInputString,
DWORD  dwInputStringSize,
LPSTR  szString 
)

Definition at line 1757 of file dialogs.c.

{
  DWORD i;
  DWORD iInputStringCounter;
  DWORD iInputStringLen;
  DWORD iStringLen;


  iInputStringLen = strlen(szInputString);
  iStringLen      = strlen(szString);

  if((iInputStringLen + iStringLen) >= dwInputStringSize)
    return;

  iInputStringCounter = iInputStringLen;
  for(i = 0; i < iStringLen; i++)
  {
    if(szString[i] != '~')
      szInputString[iInputStringCounter++] = szString[i];
    else
      if (szString[i-1] == '(') {
         szInputString[iInputStringCounter-1] = '\0';
         break;
      }
  }
}

Here is the caller graph for this function:

BOOL AskCancelDlg ( HWND  hDlg)

Definition at line 55 of file dialogs.c.

{
  char szDlgQuitTitle[MAX_BUF];
  char szDlgQuitMsg[MAX_BUF];
  char szMsg[MAX_BUF];
  BOOL bRv = FALSE;

  if((sgProduct.ulMode != SILENT) && (sgProduct.ulMode != AUTO))
  {
    if(!GetPrivateProfileString("Messages", "DLGQUITTITLE", "", szDlgQuitTitle, sizeof(szDlgQuitTitle), szFileIniInstall))
      WinPostQueueMsg(0, WM_QUIT, 1, 0);
    else if(!GetPrivateProfileString("Messages", "DLGQUITMSG", "", szDlgQuitMsg, sizeof(szDlgQuitMsg), szFileIniInstall))
      WinPostQueueMsg(0, WM_QUIT, 1, 0);
    else if(WinMessageBox(HWND_DESKTOP, hDlg, szDlgQuitMsg, szDlgQuitTitle, 0, MB_YESNO | MB_ICONQUESTION | MB_MOVEABLE | MB_DEFBUTTON2 | MB_APPLMODAL) == MBID_YES)
    {
      WinDestroyWindow(hDlg);
      WinPostQueueMsg(0, WM_QUIT, 0, 0);
      bRv = TRUE;
    }
  }
  else
  {
    GetPrivateProfileString("Strings", "Message Cancel Setup AUTO mode", "", szMsg, sizeof(szMsg), szFileIniConfig);
    ShowMessage(szMsg, TRUE);
    DosSleep(5000);
    ShowMessage(szMsg, FALSE);
    bRv = TRUE;
  }

  return(bRv);
} 
BOOL BrowseForDirectory ( HWND  hDlg,
char *  szCurrDir 
)

Definition at line 489 of file dialogs.c.

{ 
  FILEDLG        filedlg;
  char           ftitle[MAX_PATH];
  char           szBuf[MAX_BUF];
  char           szSearchPathBuf[MAX_BUF];
  char           szDlgBrowseTitle[MAX_BUF];
  BOOL           bRet;
  char*          caret;

  memset(szDlgBrowseTitle, 0, sizeof(szDlgBrowseTitle));
  GetPrivateProfileString("Messages", "DLGBROWSETITLE", "", szDlgBrowseTitle, sizeof(szDlgBrowseTitle), szFileIniInstall);

  memset(&filedlg, 0, sizeof(FILEDLG));
  filedlg.cbSize = sizeof(FILEDLG);
  filedlg.pszTitle = szDlgBrowseTitle;
  strcpy(filedlg.szFullFile, szCurrDir);
  strncat(filedlg.szFullFile, "\\", 1);
  strncat(filedlg.szFullFile, "^", 1);
  filedlg.fl = FDS_OPEN_DIALOG | FDS_CENTER;
  filedlg.pfnDlgProc = DirDialogProc;
  WinFileDlg(HWND_DESKTOP, hDlg, &filedlg);
  caret = strstr(filedlg.szFullFile, "^");
  if (caret) {
    *(caret-1) = '\0';
  } else {
    /* Something went horribly wrong. Usually this means they typed a filename */
    /* that actually exists. */
    /* If this is the case, use the parent directory */
  }

  if (filedlg.lReturn == DID_OK) {
    bRet = TRUE;
  } else {
    strcpy(szTempSetupPath, szCurrDir);
    bRet = FALSE;
  }

  return(bRet);
}
LRESULT CALLBACK BrowseHookProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 467 of file dialogs.c.

{
  DWORD dwIndex;
  DWORD dwLoop;
  char  szBuf[MAX_BUF];
  char  szBufIndex[MAX_BUF];
  char  szPath[MAX_BUF];
  HWND  hwndLBFolders;

  hwndLBFolders = GetDlgItem(hDlg, 1121);
  switch(message)
  {
    case WM_INITDIALOG:
      SetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szTempSetupPath);

      RepositionWindow(hDlg, NO_BANNER_IMAGE);

      OldBrowseWndProc     = SubclassWindow(hwndLBFolders, (WNDPROC)ListBoxBrowseWndProc);
      gdwIndexLastSelected = SendDlgItemMessage(hDlg, 1121, LB_GETCURSEL, 0, (LPARAM)0);

      SetWindowText(hDlg, sgInstallGui.szSelectDirectory);
      SetDlgItemText(hDlg, 1092, sgInstallGui.szDirectories_);
      SetDlgItemText(hDlg, 1091, sgInstallGui.szDrives_);
      SetDlgItemText(hDlg, 1, sgInstallGui.szOk);
      SetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel);
      SendDlgItemMessage (hDlg, DLG_BROWSE_DIR, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); 
      SendDlgItemMessage (hDlg, 1092, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); 
      SendDlgItemMessage (hDlg, 1091, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); 
      SendDlgItemMessage (hDlg, 1, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); 
      SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L); 
      SendDlgItemMessage (hDlg, IDC_EDIT_DESTINATION, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L); 
      SendDlgItemMessage (hDlg, 1121, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L); 
      SendDlgItemMessage (hDlg, 1137, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L); 
      break;

    case WM_COMMAND:
      switch(LOWORD(wParam))
      {
        case 1121:
          if(HIWORD(wParam) == LBN_DBLCLK)
          {
            dwIndex = SendDlgItemMessage(hDlg, 1121, LB_GETCURSEL, 0, (LPARAM)0);
            SendDlgItemMessage(hDlg, 1121, LB_GETTEXT, 0, (LPARAM)szPath);

            if(gdwIndexLastSelected < dwIndex)
            {
              for(dwLoop = 1; dwLoop <= gdwIndexLastSelected; dwLoop++)
              {
                SendDlgItemMessage(hDlg, 1121, LB_GETTEXT, dwLoop, (LPARAM)szBufIndex);
                AppendBackSlash(szPath, sizeof(szPath));
                lstrcat(szPath, szBufIndex);
              }

              SendDlgItemMessage(hDlg, 1121, LB_GETTEXT, dwIndex, (LPARAM)szBufIndex);
              AppendBackSlash(szPath, sizeof(szPath));
              lstrcat(szPath, szBufIndex);
            }
            else
            {
              for(dwLoop = 1; dwLoop <= dwIndex; dwLoop++)
              {
                SendDlgItemMessage(hDlg, 1121, LB_GETTEXT, dwLoop, (LPARAM)szBufIndex);
                AppendBackSlash(szPath, sizeof(szPath));
                lstrcat(szPath, szBufIndex);
              }
            }
            SetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szPath);
          }
          break;

        case IDOK:
          SaveWindowPosition(hDlg);
          GetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szBuf, MAX_BUF);
          if(*szBuf == '\0')
          {
            char szEDestinationPath[MAX_BUF];

            GetPrivateProfileString("Messages", "ERROR_DESTINATION_PATH", "", szEDestinationPath, sizeof(szEDestinationPath), szFileIniInstall);
            MessageBox(hDlg, szEDestinationPath, NULL, MB_OK | MB_ICONEXCLAMATION);
            break;
          }

          AppendBackSlash(szBuf, sizeof(szBuf));

          /* Make sure that the path is not within the windows dir */
          if(IsPathWithinWindir(szBuf))
          {
              char errorMsg[MAX_BUF];
              char errorMsgTitle[MAX_BUF];

              GetPrivateProfileString("Messages", "ERROR_PATH_WITHIN_WINDIR",
                  "", errorMsg, sizeof(errorMsg), szFileIniInstall);
              GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "",
                  errorMsgTitle, sizeof(errorMsgTitle), szFileIniInstall);
              MessageBox(hDlg, errorMsg, errorMsgTitle, MB_OK | MB_ICONERROR);
              break;
          }

          /* Create the path if it does not exist */
          if(FileExists(szBuf) == FALSE)
          {
            char szBufTemp[MAX_BUF];
            char szBuf2[MAX_PATH];

            if(CreateDirectoriesAll(szBuf, ADD_TO_UNINSTALL_LOG) != WIZ_OK)
            {
              char szECreateDirectory[MAX_BUF];
              char szEMessageTitle[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);

              GetPrivateProfileString("Messages", "ERROR_MESSAGE_TITLE", "", szEMessageTitle, sizeof(szEMessageTitle), szFileIniInstall);

              MessageBox(hDlg, szBuf, szEMessageTitle, 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;
          }

          lstrcpy(szTempSetupPath, szBuf);
          RemoveBackSlash(szTempSetupPath);
          UnSubclassWindow(hwndLBFolders, &OldBrowseWndProc);
          EndDialog(hDlg, 0);
          break;
      }
      break;
  }
  return(0);
}

Here is the caller graph for this function:

Definition at line 2535 of file dialogs.c.

{
  HRESULT hrErr;
  char    szDestPath[MAX_BUF];
  char    szInstallLogFile[MAX_BUF];

        LogISDestinationPath();
        LogISSetupType();
        LogISComponentsSelected();
        LogISComponentsToDownload();
        LogISDiskSpace(gdsnComponentDSRequirement);

        strcpy(szDestPath, sgProduct.szPath);
        if(*sgProduct.szSubPath != '\0')
        {
          AppendBackSlash(szDestPath, sizeof(szDestPath));
          strcat(szDestPath, sgProduct.szSubPath);
        }
        AppendBackSlash(szDestPath, sizeof(szDestPath));

        /* Set global var, that determines where the log file is to update, to
         * not use the TEMP dir *before* the FileCopy() calls because we want
         * to log the FileCopy() calls to where the log files were copied to.
         * This is possible because the logging, that is done within the
         * FileCopy() function, is done after the actual copy
         */
        gbILUseTemp = FALSE;

        /* copy the install_wizard.log file from the temp\ns_temp dir to
         * the destination dir and use the new destination file to continue
         * logging.
         */
        strcpy(szInstallLogFile, szTempDir);
        AppendBackSlash(szInstallLogFile, sizeof(szInstallLogFile));
        strcat(szInstallLogFile, FILE_INSTALL_LOG);
        FileCopy(szInstallLogFile, szDestPath, FALSE, FALSE);
        DosDelete(szInstallLogFile);

        /* copy the install_status.log file from the temp\ns_temp dir to
         * the destination dir and use the new destination file to continue
         * logging.
         */
        strcpy(szInstallLogFile, szTempDir);
        AppendBackSlash(szInstallLogFile, sizeof(szInstallLogFile));
        strcat(szInstallLogFile, FILE_INSTALL_STATUS_LOG);
        FileCopy(szInstallLogFile, szDestPath, FALSE, FALSE);
        DosDelete(szInstallLogFile);

        /* PRE_DOWNLOAD process file manipulation functions */
        ProcessFileOpsForAll(T_PRE_DOWNLOAD);

        if(RetrieveArchives() == WIZ_OK)
        {
          /* Check to see if Turbo is required.  If so, set the
           * appropriate Windows registry keys */
          SetTurboArgs();

          if(gbDownloadTriggered || gbPreviousUnfinishedDownload)
            SetSetupState(SETUP_STATE_UNPACK_XPCOM);

          /* POST_DOWNLOAD process file manipulation functions */
          ProcessFileOpsForAll(T_POST_DOWNLOAD);
          /* PRE_XPCOM process file manipulation functions */
          ProcessFileOpsForAll(T_PRE_XPCOM);

          if(ProcessXpcomFile() != FO_SUCCESS)
          {
            bSDUserCanceled = TRUE;
            CleanupXpcomFile();
            WinPostQueueMsg(0, WM_QUIT, 0, 0);

            return;
          }

          if(gbDownloadTriggered || gbPreviousUnfinishedDownload)
            SetSetupState(SETUP_STATE_INSTALL_XPI); // clears and sets new setup state

          /* POST_XPCOM process file manipulation functions */
          ProcessFileOpsForAll(T_POST_XPCOM);
          /* PRE_SMARTUPDATE process file manipulation functions */
          ProcessFileOpsForAll(T_PRE_SMARTUPDATE);

          /* save the installer files in the local machine */
          if(diAdditionalOptions.bSaveInstaller)
            SaveInstallerFiles();

          if(CheckInstances())
          {
            bSDUserCanceled = TRUE;
            CleanupXpcomFile();
            WinPostQueueMsg(0, WM_QUIT, 0, 0);

            return;
          }

          strcat(szDestPath, "uninstall\\");
          CreateDirectoriesAll(szDestPath, TRUE);

          /* save the installer files in the local machine */
          if(diAdditionalOptions.bSaveInstaller)
            SaveInstallerFiles();

          hrErr = SmartUpdateJars();
          if((hrErr == WIZ_OK) || (hrErr == 999))
          {
            UpdateJSProxyInfo();

            /* POST_SMARTUPDATE process file manipulation functions */
            ProcessFileOpsForAll(T_POST_SMARTUPDATE);
            /* PRE_LAUNCHAPP process file manipulation functions */
            ProcessFileOpsForAll(T_PRE_LAUNCHAPP);

            LaunchApps();

            /* POST_LAUNCHAPP process file manipulation functions */
            ProcessFileOpsForAll(T_POST_LAUNCHAPP);
            /* DEPEND_REBOOT process file manipulation functions */
            ProcessFileOpsForAll(T_DEPEND_REBOOT);

            ProcessOS2Integration();

            UnsetSetupState(); // clear setup state
            if(!gbIgnoreProgramFolderX)
              ProcessProgramFolderShowCmd();

            CleanupArgsRegistry();
            CleanupPreviousVersionINIKeys();
            if(NeedReboot())
            {
              CleanupXpcomFile();
              hDlgCurrent = InstantiateDialog(hWndMain, DLG_RESTART, diReboot.szTitle, DlgProcReboot);
            }
            else
            {
              CleanupXpcomFile();
              WinPostQueueMsg(0, WM_QUIT, 0, 0);
            }
          }
          else
          {
            CleanupXpcomFile();
            WinPostQueueMsg(0, WM_QUIT, 0, 0);
          }
        }
        else
        {
          bSDUserCanceled = TRUE;
          CleanupXpcomFile();
          CleanupArgsRegistry();
          WinPostQueueMsg(0, WM_QUIT, 0, 0);
        }
        gbProcessingXpnstallFiles = FALSE;
}
void DisableSystemMenuItems ( HWND  hWnd,
BOOL  bDisableClose 
)

Definition at line 146 of file dialogs.c.

{
  EnableMenuItem(GetSystemMenu(hWnd, FALSE), SC_RESTORE,  MF_BYCOMMAND | MF_GRAYED);
  EnableMenuItem(GetSystemMenu(hWnd, FALSE), SC_SIZE,     MF_BYCOMMAND | MF_GRAYED);
  EnableMenuItem(GetSystemMenu(hWnd, FALSE), SC_MAXIMIZE, MF_BYCOMMAND | MF_GRAYED);

  if(bDisableClose)
    EnableMenuItem(GetSystemMenu(hWnd, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
}

Here is the caller graph for this function:

MRESULT EXPENTRY DlgProcAdditionalOptions ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 1620 of file dialogs.c.

{
  SWP   swpDlg;
  char  szBuf[MAX_BUF];
  HWND  hwndCBSiteSelector;
  int   iIndex;
  ssi   *ssiTemp;
  char  szCBDefault[MAX_BUF];

  hwndCBSiteSelector = WinWindowFromID(hDlg, IDC_LIST_SITE_SELECTOR);

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
//      if(gdwSiteSelectorStatus == SS_HIDE)
//      {
//        WinShowWindow(WinWindowFromID(hDlg, IDC_MESSAGE0),  FALSE);
//        WinShowWindow(WinWindowFromID(hDlg, IDC_LIST_SITE_SELECTOR),  FALSE);
//      }

      if(diAdditionalOptions.bShowHomepageOption == FALSE)
      {
        WinShowWindow(WinWindowFromID(hDlg, IDC_MESSAGE0),  FALSE);
        WinShowWindow(WinWindowFromID(hDlg, IDC_CHECK_RECAPTURE_HOMEPAGE),  FALSE);
      }

      if(GetTotalArchivesToDownload() == 0)
     {
        WinShowWindow(WinWindowFromID(hDlg, IDC_MESSAGE1),  FALSE);
        WinShowWindow(WinWindowFromID(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES),  FALSE);
        WinShowWindow(WinWindowFromID(hDlg, IDC_EDIT_LOCAL_INSTALLER_PATH), FALSE);
        WinShowWindow(WinWindowFromID(hDlg, IDC_BUTTON_PROXY_SETTINGS), FALSE);
      }

      WinSetWindowText(hDlg, diAdditionalOptions.szTitle);
      WinSetDlgItemText(hDlg, IDC_MESSAGE0, diAdditionalOptions.szMessage0);
      WinSetDlgItemText(hDlg, IDC_MESSAGE1, diAdditionalOptions.szMessage1);

      GetPrivateProfileString("Strings", "IDC Save Installer Files", "", szBuf, sizeof(szBuf), szFileIniConfig);
      WinSetDlgItemText(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, szBuf);
      GetPrivateProfileString("Strings", "IDC Recapture Homepage", "", szBuf, sizeof(szBuf), szFileIniConfig);
      WinSetDlgItemText(hDlg, IDC_CHECK_RECAPTURE_HOMEPAGE, szBuf);

      GetSaveInstallerPath(szBuf, sizeof(szBuf));
      WinSetDlgItemText(hDlg, IDC_EDIT_LOCAL_INSTALLER_PATH, szBuf);

      WinSetDlgItemText(hDlg, IDC_BUTTON_PROXY_SETTINGS, sgInstallGui.szProxySettings_);
      WinSetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
      WinSetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);

      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      ssiTemp = ssiSiteSelector;
      do
      {
        if(ssiTemp == NULL)
          break;

        WinSendMsg(hwndCBSiteSelector, LM_INSERTITEM, 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 = WinSendMsg(hwndCBSiteSelector, LM_SEARCHSTRING, MPFROM2SHORT(0, LIT_FIRST), (LPARAM)szCBDefault)) != LIT_NONE))
          WinSendMsg(hwndCBSiteSelector, LM_SELECTITEM, (WPARAM)iIndex, 0);
        else
          WinSendMsg(hwndCBSiteSelector, LM_SELECTITEM, 0, 0);
      }
      else if((iIndex = WinSendMsg(hwndCBSiteSelector, LM_SEARCHSTRING, MPFROM2SHORT(0, LIT_FIRST), (LPARAM)szSiteSelectorDescription)) != LIT_NONE)
        WinSendMsg(hwndCBSiteSelector, LM_SELECTITEM, (WPARAM)iIndex, 0);
      else
        WinSendMsg(hwndCBSiteSelector, LM_SELECTITEM, 0, 0);

      if(diAdditionalOptions.bSaveInstaller)
        WinCheckButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, 1);
      else
        WinCheckButton(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES, 0);

      if(diAdditionalOptions.bRecaptureHomepage)
        WinCheckButton(hDlg, IDC_CHECK_RECAPTURE_HOMEPAGE, 1);
      else
        WinCheckButton(hDlg, IDC_CHECK_RECAPTURE_HOMEPAGE, 0);

      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDWIZNEXT:
          SaveAdditionalOptions(hDlg, hwndCBSiteSelector);
          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
          SaveAdditionalOptions(hDlg, hwndCBSiteSelector);
          WinDestroyWindow(hDlg);
          DlgSequence(PREV_DLG);
          break;

        case IDC_BUTTON_ADDITIONAL_SETTINGS:
          SaveAdditionalOptions(hDlg, hwndCBSiteSelector);
          WinDestroyWindow(hDlg);
          DlgSequence(OTHER_DLG_1);
          break;

        case IDCANCEL:
          AskCancelDlg(hDlg);
          return (MRESULT)TRUE;
          break;

        default:
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

Here is the caller graph for this function:

MRESULT EXPENTRY DlgProcAdvancedSettings ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 1497 of file dialogs.c.

{
  SWP   swpDlg;
  char  szBuf[MAX_BUF];

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      WinSetWindowText(hDlg, diAdvancedSettings.szTitle);
      WinSetDlgItemText(hDlg, IDC_MESSAGE0,          diAdvancedSettings.szMessage0);
      WinSetDlgItemText(hDlg, IDC_EDIT_PROXY_SERVER, diAdvancedSettings.szProxyServer);
      WinSetDlgItemText(hDlg, IDC_EDIT_PROXY_PORT,   diAdvancedSettings.szProxyPort);
      WinSetDlgItemText(hDlg, IDC_EDIT_PROXY_USER,   diAdvancedSettings.szProxyUser);
      WinSetDlgItemText(hDlg, IDC_EDIT_PROXY_PASSWD, diAdvancedSettings.szProxyPasswd);

      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      GetPrivateProfileString("Strings", "IDC Use FTP", "", szBuf, sizeof(szBuf), szFileIniConfig);
      WinSetDlgItemText(hDlg, IDC_USE_FTP, szBuf);
      GetPrivateProfileString("Strings", "IDC Use HTTP", "", szBuf, sizeof(szBuf), szFileIniConfig);
      WinSetDlgItemText(hDlg, IDC_USE_HTTP, szBuf);

      WinSetDlgItemText(hDlg, IDC_STATIC, sgInstallGui.szProxySettings);
      WinSetDlgItemText(hDlg, IDC_STATIC1, sgInstallGui.szServer);
      WinSetDlgItemText(hDlg, IDC_STATIC2, sgInstallGui.szPort);
      WinSetDlgItemText(hDlg, IDC_STATIC3, sgInstallGui.szUserId);
      WinSetDlgItemText(hDlg, IDC_STATIC4, sgInstallGui.szPassword);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szOk_);
      WinSetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);

      switch(diAdditionalOptions.dwUseProtocol)
      {
        case UP_HTTP:
          WinCheckButton(hDlg, IDC_USE_FTP,  0);
          WinCheckButton(hDlg, IDC_USE_HTTP, 1);
          break;

        case UP_FTP:
        default:
          WinCheckButton(hDlg, IDC_USE_FTP,  1);
          WinCheckButton(hDlg, IDC_USE_HTTP, 0);
          break;

      }

      if((diAdditionalOptions.bShowProtocols) && (diAdditionalOptions.bUseProtocolSettings))
      {
        WinShowWindow(WinWindowFromID(hDlg, IDC_USE_FTP),  TRUE);
        WinShowWindow(WinWindowFromID(hDlg, IDC_USE_HTTP), TRUE);
      }
      else
      {
        WinShowWindow(WinWindowFromID(hDlg, IDC_USE_FTP),  FALSE);
        WinShowWindow(WinWindowFromID(hDlg, IDC_USE_HTTP), FALSE);
      }

      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDWIZNEXT:
          /* get the proxy server and port information */
          WinQueryDlgItemText(hDlg, IDC_EDIT_PROXY_SERVER, MAX_BUF, diAdvancedSettings.szProxyServer);
          WinQueryDlgItemText(hDlg, IDC_EDIT_PROXY_PORT,   MAX_BUF, diAdvancedSettings.szProxyPort);
          WinQueryDlgItemText(hDlg, IDC_EDIT_PROXY_USER,   MAX_BUF, diAdvancedSettings.szProxyUser);
          WinQueryDlgItemText(hDlg, IDC_EDIT_PROXY_PASSWD, MAX_BUF, diAdvancedSettings.szProxyPasswd);

          SaveDownloadProtocolOption(hDlg);
          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
        case IDCANCEL:
          WinDestroyWindow(hDlg);
          DlgSequence(PREV_DLG);
          break;

        default:
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

Here is the caller graph for this function:

MRESULT EXPENTRY DlgProcLicense ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 221 of file dialogs.c.

{
  char            szBuf[MAX_BUF];
  LPSTR           szLicenseFilenameBuf = NULL;
  DWORD           dwFileSize;
  DWORD           dwBytesRead;
  HANDLE          hFLicense;
  FILE            *fLicense;
  SWP             swpDlg;

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      /* Initialize controls */
      WinSetWindowText(hDlg, diLicense.szTitle);
      WinSetDlgItemText(hDlg, IDC_MESSAGE0, diLicense.szMessage0);
      WinSetDlgItemText(hDlg, IDC_MESSAGE1, diLicense.szMessage1);
      WinSetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szAccept_);
      WinSetDlgItemText(hDlg, DID_CANCEL, sgInstallGui.szDecline_);

      /* If LICENSE.TXT exists, read it into the MLE */
      strcpy(szBuf, szSetupDir);
      AppendBackSlash(szBuf, sizeof(szBuf));
      strcat(szBuf, diLicense.szLicenseFilename);

      if((fLicense = fopen(szBuf, "rb")) != NULL)
      {
        fseek(fLicense, 0L, SEEK_END);
        dwFileSize = ftell(fLicense);
        fseek(fLicense, 0L, SEEK_SET);
        if((szLicenseFilenameBuf = NS_GlobalAlloc(dwFileSize+1)) != NULL) {
          dwBytesRead = fread(szLicenseFilenameBuf, sizeof(char), dwFileSize, fLicense);
          szLicenseFilenameBuf[dwFileSize] = '\0';
          WinSetDlgItemText(hDlg, IDC_EDIT_LICENSE, szLicenseFilenameBuf);
          FreeMemory(&szLicenseFilenameBuf);
        }
        fclose(fLicense);
      }

      /* Center dialog */
      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);
      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDWIZNEXT:
          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
          WinDestroyWindow(hDlg);
          DlgSequence(PREV_DLG);
          break;

        case IDCANCEL:
          AskCancelDlg(hDlg);
          return (MRESULT)TRUE;
          break;

        default:
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

LRESULT CALLBACK DlgProcMain ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
MRESULT EXPENTRY DlgProcMessage ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 2156 of file dialogs.c.

{
  SWP       swpDlg;
  HWND      hSTMessage = WinWindowFromID(hDlg, IDC_MESSAGE); /* handle to the Static Text message window */
  HPS       hpsSTMessage;
  RECTL     rectlString;
  char      szBuf[MAX_BUF];
  char      szBuf2[MAX_BUF];

  memset(szBuf, 0, sizeof(szBuf));
  memset(szBuf2, 0, sizeof(szBuf2));

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      if(GetPrivateProfileString("Messages", "STR_MESSAGEBOX_TITLE", "", szBuf2, sizeof(szBuf2), szFileIniInstall))
      {
        if((sgProduct.szProductName != NULL) && (*sgProduct.szProductName != '\0'))
          sprintf(szBuf, szBuf2, sgProduct.szProductName);
        else
          sprintf(szBuf, szBuf2, "");
      }
      else if((sgProduct.szProductName != NULL) && (*sgProduct.szProductName != '\0'))
        strcpy(szBuf, sgProduct.szProductName);

      WinSetWindowText(hDlg, szBuf);
      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDC_MESSAGE:
          hpsSTMessage = WinGetPS(hSTMessage);

          rectlString.xLeft = 0;
          rectlString.xRight = 10000;
          rectlString.yTop = 10000;
          rectlString.yBottom = 0;
          WinDrawText(hpsSTMessage, strlen((char*)mp2), (char*)mp2,
                            &rectlString, 0, 0,
                            DT_BOTTOM | DT_QUERYEXTENT | DT_TEXTATTRS | DT_WORDBREAK);
          WinReleasePS(hpsSTMessage);

          WinSetWindowPos(hDlg, HWND_TOP,
                      (gSystemInfo.lScreenX/2)-((rectlString.xRight + 55)/2),
                      (gSystemInfo.lScreenY/2)-((rectlString.yTop + 50)/2),
                      rectlString.xRight + 55,
                      rectlString.yTop + 50,
                      SWP_SIZE | SWP_MOVE);

          WinQueryWindowPos(hDlg, &swpDlg);

          WinSetWindowPos(hSTMessage,
                         HWND_TOP,
                         gSystemInfo.lDlgFrameX,
                         gSystemInfo.lDlgFrameY,
                         swpDlg.cx-2*gSystemInfo.lDlgFrameX,
                         swpDlg.cy-2*gSystemInfo.lDlgFrameY-gSystemInfo.lTitleBarY,
                         SWP_SIZE | SWP_MOVE);

          WinSetDlgItemText(hDlg, IDC_MESSAGE, (PSZ)mp2);
          return (MRESULT)TRUE;
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}
MRESULT EXPENTRY DlgProcOS2Integration ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 1344 of file dialogs.c.

{
  char szBuf[MAX_BUF];
  HWND hcbCheck0;
  HWND hcbCheck1;
  HWND hcbCheck2;
  HWND hcbCheck3;
  HWND hDestinationPath;
  SWP                 swpDlg;

  hcbCheck0 = WinWindowFromID(hDlg, IDC_CHECK0);
  hcbCheck1 = WinWindowFromID(hDlg, IDC_CHECK1);
  hcbCheck2 = WinWindowFromID(hDlg, IDC_CHECK2);
  hcbCheck3 = WinWindowFromID(hDlg, IDC_CHECK3);

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      WinSetWindowText(hDlg, diOS2Integration.szTitle);

      if (diOS2Integration.szHomeDirectory[0]) {
        strcpy(szTempSetupPath, diOS2Integration.szHomeDirectory);
        hDestinationPath = WinWindowFromID(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */
        TruncateString(hDestinationPath, szTempSetupPath, szBuf, sizeof(szBuf));
      } else {
        strcpy(szTempSetupPath, sgProduct.szPath);
        hDestinationPath = WinWindowFromID(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */
        TruncateString(hDestinationPath, szTempSetupPath, szBuf, sizeof(szBuf));
      }

      WinSetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szBuf);

      WinSetDlgItemText(hDlg, IDC_MESSAGE0, diOS2Integration.szMessage0);
      WinSetDlgItemText(hDlg, IDC_MESSAGE1, diOS2Integration.szMessage1);

      if(diOS2Integration.oiCBMakeDefaultBrowser.bEnabled)
      {
        WinShowWindow(hcbCheck0, TRUE);
        WinCheckButton(hDlg, IDC_CHECK0, diOS2Integration.oiCBMakeDefaultBrowser.bCheckBoxState);
        WinSetDlgItemText(hDlg, IDC_CHECK0, diOS2Integration.oiCBMakeDefaultBrowser.szDescription);
      }
      else
        WinShowWindow(hcbCheck0, FALSE);

      if(diOS2Integration.oiCBAssociateHTML.bEnabled)
      {
        WinShowWindow(hcbCheck1, TRUE);
        WinCheckButton(hDlg, IDC_CHECK1, diOS2Integration.oiCBAssociateHTML.bCheckBoxState);
        WinSetDlgItemText(hDlg, IDC_CHECK1, diOS2Integration.oiCBAssociateHTML.szDescription);
      }
      else
        WinShowWindow(hcbCheck1, FALSE);

      if(diOS2Integration.oiCBUpdateCONFIGSYS.bEnabled)
      {
        WinShowWindow(hcbCheck2, TRUE);
        WinCheckButton(hDlg, IDC_CHECK2, diOS2Integration.oiCBUpdateCONFIGSYS.bCheckBoxState);
        WinSetDlgItemText(hDlg, IDC_CHECK2, diOS2Integration.oiCBUpdateCONFIGSYS.szDescription);
      }
      else
        WinShowWindow(hcbCheck2, FALSE);

      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      WinSetDlgItemText(hDlg, IDC_BUTTON_BROWSE, sgInstallGui.szBrowse_);
      WinSetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
      WinSetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);
      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDC_BUTTON_BROWSE:
          if (BrowseForDirectory(hDlg, szTempSetupPath)) {
            strcpy(diOS2Integration.szHomeDirectory, szTempSetupPath);
          }

          hDestinationPath = WinWindowFromID(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */
          TruncateString(hDestinationPath, szTempSetupPath, szBuf, sizeof(szBuf));
          WinSetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szBuf);
          return (MRESULT)TRUE;
          break;
        case IDWIZNEXT:
          if(diOS2Integration.oiCBMakeDefaultBrowser.bEnabled)
          {
            if(WinQueryButtonCheckstate(hDlg, IDC_CHECK0) == 1)
              diOS2Integration.oiCBMakeDefaultBrowser.bCheckBoxState = TRUE;
            else
              diOS2Integration.oiCBMakeDefaultBrowser.bCheckBoxState = FALSE;
          }

          if(diOS2Integration.oiCBAssociateHTML.bEnabled)
          {
            if(WinQueryButtonCheckstate(hDlg, IDC_CHECK1) == 1)
              diOS2Integration.oiCBAssociateHTML.bCheckBoxState = TRUE;
            else
              diOS2Integration.oiCBAssociateHTML.bCheckBoxState = FALSE;
          }

          if(diOS2Integration.oiCBUpdateCONFIGSYS.bEnabled)
          {
            if(WinQueryButtonCheckstate(hDlg, IDC_CHECK2) == 1)
              diOS2Integration.oiCBUpdateCONFIGSYS.bCheckBoxState = TRUE;
            else
              diOS2Integration.oiCBUpdateCONFIGSYS.bCheckBoxState = FALSE;
          }

          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
          WinDestroyWindow(hDlg);
          DlgSequence(PREV_DLG);
          break;

        case IDCANCEL:
          AskCancelDlg(hDlg);
          return (MRESULT)TRUE;
          break;

        default:
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

Here is the caller graph for this function:

LRESULT CALLBACK DlgProcQuickLaunch ( HWND  hDlg,
UINT  msg,
WPARAM  wParam,
LONG  lParam 
)

Definition at line 2412 of file dialogs.c.

{
  LPSTR szMessage = NULL;
  char  szBuf[MAX_BUF];

  switch(msg)
  {
    case WM_INITDIALOG:
      DisableSystemMenuItems(hDlg, FALSE);
      SetWindowText(hDlg, diQuickLaunch.szTitle);

      GetPrivateProfileString("Strings", "IDC Turbo Mode", "", szBuf, sizeof(szBuf), szFileIniConfig);
      SetDlgItemText(hDlg, IDC_CHECK_TURBO_MODE, szBuf);
      SetDlgItemText(hDlg, IDC_STATIC, sgInstallGui.szCurrentSettings);
      SetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
      SetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
      SetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);
      SendDlgItemMessage (hDlg, IDC_STATIC, 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_MESSAGE0, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
      SendDlgItemMessage (hDlg, IDC_MESSAGE1, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
      SendDlgItemMessage (hDlg, IDC_MESSAGE2, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
      SendDlgItemMessage (hDlg, IDC_CHECK_TURBO_MODE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);

      RepositionWindow(hDlg, NO_BANNER_IMAGE);

      SetDlgItemText(hDlg, IDC_MESSAGE0, diQuickLaunch.szMessage0);
      SetDlgItemText(hDlg, IDC_MESSAGE1, diQuickLaunch.szMessage1);
      SetDlgItemText(hDlg, IDC_MESSAGE2, diQuickLaunch.szMessage2);

      if(diQuickLaunch.bTurboModeEnabled)
        ShowWindow(GetDlgItem(hDlg, IDC_CHECK_TURBO_MODE),  SW_SHOW);
      else
      {
        ShowWindow(GetDlgItem(hDlg, IDC_CHECK_TURBO_MODE),  SW_HIDE);
        diQuickLaunch.bTurboMode = FALSE;
      }

      if(diQuickLaunch.bTurboMode)
        CheckDlgButton(hDlg, IDC_CHECK_TURBO_MODE, BST_CHECKED);
      else
        CheckDlgButton(hDlg, IDC_CHECK_TURBO_MODE, BST_UNCHECKED);

      ClosePreviousDialog();
      break;

    case WM_COMMAND:
      switch(LOWORD(wParam))
      {
        case IDWIZNEXT:
          SaveWindowPosition(hDlg);
          if(diQuickLaunch.bTurboModeEnabled)
          {
            if(IsDlgButtonChecked(hDlg, IDC_CHECK_TURBO_MODE) == BST_CHECKED)
              diQuickLaunch.bTurboMode = TRUE;
            else
              diQuickLaunch.bTurboMode = FALSE;
          }
 
          sgProduct.lastDialog = hDlg;
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
          SaveWindowPosition(hDlg);
          /* remember the last state of the TurboMode checkbox */
          if(IsDlgButtonChecked(hDlg, IDC_CHECK_TURBO_MODE) == BST_CHECKED) {
            diQuickLaunch.bTurboMode = TRUE;
          }
          else {
            diQuickLaunch.bTurboMode = FALSE;
          }
          sgProduct.lastDialog = hDlg;
          DlgSequence(PREV_DLG);
          break;

        case IDCANCEL:
          AskCancelDlg(hDlg);
          break;

        default:
          break;
      }
      break;
  }
  return(0);
}

Here is the caller graph for this function:

MRESULT CALLBACK DlgProcReboot ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 2087 of file dialogs.c.

{
  HANDLE            hToken;
  HWND              hRadioYes;
  SWP               swpDlg;

  hRadioYes = WinWindowFromID(hDlg, IDC_RADIO_YES);

  switch(msg)
  {
    case WM_INITDLG:
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      WinCheckButton(hDlg, IDC_RADIO_YES, 1);
      WinSetFocus(HWND_DESKTOP, hRadioYes);

      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      WinSetDlgItemText(hDlg, 202, sgInstallGui.szSetupMessage);
      WinSetDlgItemText(hDlg, IDC_RADIO_YES, sgInstallGui.szYesRestart);
      WinSetDlgItemText(hDlg, IDC_RADIO_NO, sgInstallGui.szNoRestart);
      WinSetDlgItemText(hDlg, DID_OK, sgInstallGui.szOk);
      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case DID_OK:
          if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_YES) == 1)
          {
            WinDestroyWindow(hDlg);
            WinPostQueueMsg(0, WM_QUIT, 0, 0);
            WinDestroyWindow(hWndMain);

            // Reboot the system and force all applications to close.
            WinShutdownSystem(0, 0);
          }
          else
          {
            WinDestroyWindow(hDlg);
            WinPostQueueMsg(0, WM_QUIT, 0, 0);
          }
          break;

        case IDCANCEL:
          WinDestroyWindow(hDlg);
          WinPostQueueMsg(0, WM_QUIT, 0, 0);
          break;

        default:
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

Here is the caller graph for this function:

MRESULT EXPENTRY DlgProcSelectAdditionalComponents ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 1202 of file dialogs.c.

{
  BOOL                bReturn = FALSE;
  siC                 *siCTemp;
  DWORD               dwIndex;
  DWORD               dwItems = MAX_BUF;
  HWND                hwndLBComponents;
  SWP                 swpDlg;
  CHAR                tchBuffer[MAX_BUF];
  POWNERITEM          pOwnerItem;
  ULONG               ulDSBuf;
  char                szBuf[MAX_BUF];

  hwndLBComponents  = WinWindowFromID(hDlg, IDC_LIST_COMPONENTS);

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      WinSetWindowText(hDlg, diSelectAdditionalComponents.szTitle);
      WinSetDlgItemText(hDlg, IDC_MESSAGE0, diSelectAdditionalComponents.szMessage0);

      siCTemp = siComponents;
      if(siCTemp != NULL)
      {
        if((!(siCTemp->dwAttributes & SIC_INVISIBLE)) && (siCTemp->dwAttributes & SIC_ADDITIONAL))
          WinSendMsg(hwndLBComponents, LM_INSERTITEM, LIT_END, (MPARAM)siCTemp->szDescriptionShort);

        siCTemp = siCTemp->Next;
        while((siCTemp != siComponents) && (siCTemp != NULL))
        {
          if((!(siCTemp->dwAttributes & SIC_INVISIBLE)) && (siCTemp->dwAttributes & SIC_ADDITIONAL))
            WinSendMsg(hwndLBComponents, LM_INSERTITEM, LIT_END, (MPARAM)siCTemp->szDescriptionShort);

          siCTemp = siCTemp->Next;
        }
        WinSetFocus(HWND_DESKTOP, hwndLBComponents);
        WinSendMsg(hwndLBComponents, LM_SELECTITEM, 0, 0);
        WinSetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(0, FALSE, AC_ADDITIONAL_COMPONENTS));
      }

      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      /* update the disk space available info in the dialog.  GetDiskSpaceAvailable()
         returns value in kbytes */
      ulDSBuf = GetDiskSpaceAvailable(sgProduct.szPath);
      _itoa(ulDSBuf, tchBuffer, 10);
      ParsePath(sgProduct.szPath, szBuf, sizeof(szBuf), FALSE, PP_ROOT_ONLY);
      RemoveBackSlash(szBuf);
      strcat(szBuf, "   ");
      strcat(szBuf, tchBuffer);
      strcat(szBuf, " KB");
      WinSetDlgItemText(hDlg, IDC_SPACE_AVAILABLE, szBuf);

      WinSetDlgItemText(hDlg, IDC_STATIC1, sgInstallGui.szAdditionalComponents_);
      WinSetDlgItemText(hDlg, IDC_STATIC2, sgInstallGui.szDescription);
      WinSetDlgItemText(hDlg, IDC_STATIC3, sgInstallGui.szTotalDownloadSize);
      WinSetDlgItemText(hDlg, IDC_STATIC4, sgInstallGui.szSpaceAvailable);
      WinSetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
      WinSetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);

      gdwACFlag = AC_ADDITIONAL_COMPONENTS;
      OldListBoxWndProc = WinSubclassWindow(hwndLBComponents, (PFNWP)NewListBoxWndProc);
      break;

    case WM_MEASUREITEM:
      return MRFROM2SHORT(CX_CHECKBOX+4+4, 0);

    case WM_DRAWITEM:
      pOwnerItem = (POWNERITEM)mp2;

      // If there are no list box items, skip this message.
      if(pOwnerItem->idItem == -1)
        break;

      DrawLBText(pOwnerItem, AC_ADDITIONAL_COMPONENTS);
      DrawCheck(pOwnerItem, AC_ADDITIONAL_COMPONENTS);

      /* update the disk space required info in the dialog.  It is already
         in Kilobytes */
      ulDSBuf = GetDiskSpaceRequired(DSR_DOWNLOAD_SIZE);
      _itoa(ulDSBuf, tchBuffer, 10);
      strcpy(szBuf, tchBuffer);
      strcat(szBuf, " KB");
      
      WinSetDlgItemText(hDlg, IDC_DOWNLOAD_SIZE, szBuf);
      return (MRESULT)TRUE;
      break;

    case WM_CONTROL:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDC_LIST_COMPONENTS:
          /* to update the long description for each component the user selected */
          if((dwIndex = WinSendMsg(hwndLBComponents, LM_QUERYSELECTION, 0, 0)) != LIT_NONE)
            WinSetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(dwIndex, FALSE, AC_ADDITIONAL_COMPONENTS));
          break;
      }
      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDWIZNEXT:
          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
          WinDestroyWindow(hDlg);
          DlgSequence(PREV_DLG);
          break;

        case IDCANCEL:
          AskCancelDlg(hDlg);
          return (MRESULT)TRUE;
          break;

        default:
          break;
      }
      break;
  }

  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

Here is the caller graph for this function:

MRESULT EXPENTRY DlgProcSelectComponents ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 1060 of file dialogs.c.

{
  BOOL                bReturn = FALSE;
  siC                 *siCTemp;
  DWORD               dwIndex;
  DWORD               dwItems = MAX_BUF;
  HWND                hwndLBComponents;
  SWP                 swpDlg;
  CHAR                tchBuffer[MAX_BUF];
  POWNERITEM          pOwnerItem;
  ULONG               ulDSBuf;
  char                szBuf[MAX_BUF];

  hwndLBComponents  = WinWindowFromID(hDlg, IDC_LIST_COMPONENTS);

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      WinSetWindowText(hDlg, diSelectComponents.szTitle);
      WinSetDlgItemText(hDlg, IDC_MESSAGE0, diSelectComponents.szMessage0);

      siCTemp = siComponents;
      if(siCTemp != NULL)
      {
        if((!(siCTemp->dwAttributes & SIC_INVISIBLE)) && (!(siCTemp->dwAttributes & SIC_ADDITIONAL)))
          WinSendMsg(hwndLBComponents, LM_INSERTITEM, LIT_END, (MPARAM)siCTemp->szDescriptionShort);

        siCTemp = siCTemp->Next;
        while((siCTemp != siComponents) && (siCTemp != NULL))
        {
          if((!(siCTemp->dwAttributes & SIC_INVISIBLE)) && (!(siCTemp->dwAttributes & SIC_ADDITIONAL)))
            WinSendMsg(hwndLBComponents, LM_INSERTITEM, LIT_END, (MPARAM)siCTemp->szDescriptionShort);

          siCTemp = siCTemp->Next;
        }
        WinSetFocus(HWND_DESKTOP, hwndLBComponents);
        WinSendMsg(hwndLBComponents, LM_SELECTITEM, 0, 0);
        WinSetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(0, FALSE, AC_COMPONENTS));
      }

      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      /* update the disk space available info in the dialog.  GetDiskSpaceAvailable()
         returns value in kbytes */
      ulDSBuf = GetDiskSpaceAvailable(sgProduct.szPath);
      _itoa(ulDSBuf, tchBuffer, 10);
      ParsePath(sgProduct.szPath, szBuf, sizeof(szBuf), FALSE, PP_ROOT_ONLY);
      RemoveBackSlash(szBuf);
      strcat(szBuf, "   ");
      strcat(szBuf, tchBuffer);
      strcat(szBuf, " KB");
      WinSetDlgItemText(hDlg, IDC_SPACE_AVAILABLE, szBuf);

      WinSetDlgItemText(hDlg, IDC_STATIC1, sgInstallGui.szComponents_);
      WinSetDlgItemText(hDlg, IDC_STATIC2, sgInstallGui.szDescription);
      WinSetDlgItemText(hDlg, IDC_STATIC3, sgInstallGui.szTotalDownloadSize);
      WinSetDlgItemText(hDlg, IDC_STATIC4, sgInstallGui.szSpaceAvailable);
      WinSetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
      WinSetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);

      gdwACFlag = AC_COMPONENTS;
      OldListBoxWndProc = WinSubclassWindow(hwndLBComponents, (PFNWP)NewListBoxWndProc);
      break;

    case WM_MEASUREITEM:
      return MRFROM2SHORT(CX_CHECKBOX+4+4, 0);

    case WM_DRAWITEM:
      pOwnerItem = (POWNERITEM)mp2;

      // If there are no list box items, skip this message.
      if(pOwnerItem->idItem == -1)
        break;

      DrawLBText(pOwnerItem, AC_COMPONENTS);
      DrawCheck(pOwnerItem, AC_COMPONENTS);

      /* update the disk space required info in the dialog.  It is already
         in Kilobytes */
      ulDSBuf = GetDiskSpaceRequired(DSR_DOWNLOAD_SIZE);
      _itoa(ulDSBuf, tchBuffer, 10);
      strcpy(szBuf, tchBuffer);
      strcat(szBuf, " KB");
      
      WinSetDlgItemText(hDlg, IDC_DOWNLOAD_SIZE, szBuf);
      return (MRESULT)TRUE;
      break;

    case WM_CONTROL:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDC_LIST_COMPONENTS:
          /* to update the long description for each component the user selected */
          if((dwIndex = WinSendMsg(hwndLBComponents, LM_QUERYSELECTION, 0, 0)) != LIT_NONE)
            WinSetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(dwIndex, FALSE, AC_COMPONENTS));
          break;
      }
      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDWIZNEXT:
          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
          WinDestroyWindow(hDlg);
          DlgSequence(PREV_DLG);
          break;

        case IDCANCEL:
          AskCancelDlg(hDlg);
          return (MRESULT)TRUE;
          break;

        default:
          break;
      }
      break;
  }

  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

MRESULT EXPENTRY DlgProcSetupType ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 577 of file dialogs.c.

{
  HWND          hRadioSt0;
  HWND          hStaticSt0;
  HWND          hRadioSt1;
  HWND          hStaticSt1;
  HWND          hRadioSt2;
  HWND          hStaticSt2;
  HWND          hRadioSt3;
  HWND          hStaticSt3;
  HWND          hReadme;
  HWND          hDestinationPath;
  SWP           swpDlg;
  char          szBuf[MAX_BUF];
  char          szBufTemp[MAX_BUF];
  char          szBufTemp2[MAX_BUF];
  HRESULT       hresult;
  HOBJECT       hobject;

  hRadioSt0   = WinWindowFromID(hDlg, IDC_RADIO_ST0);
  hStaticSt0  = WinWindowFromID(hDlg, IDC_STATIC_ST0_DESCRIPTION);
  hRadioSt1   = WinWindowFromID(hDlg, IDC_RADIO_ST1);
  hStaticSt1  = WinWindowFromID(hDlg, IDC_STATIC_ST1_DESCRIPTION);
  hRadioSt2   = WinWindowFromID(hDlg, IDC_RADIO_ST2);
  hStaticSt2  = WinWindowFromID(hDlg, IDC_STATIC_ST2_DESCRIPTION);
  hRadioSt3   = WinWindowFromID(hDlg, IDC_RADIO_ST3);
  hStaticSt3  = WinWindowFromID(hDlg, IDC_STATIC_ST3_DESCRIPTION);
  hReadme     = WinWindowFromID(hDlg, IDC_README);

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      WinSetWindowText(hDlg, diSetupType.szTitle);

      hDestinationPath = WinWindowFromID(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */
      strcpy(szTempSetupPath, sgProduct.szPath);
      TruncateString(hDestinationPath, szTempSetupPath, szBuf, sizeof(szBuf));

      WinSetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szBuf);
      WinSetDlgItemText(hDlg, IDC_STATIC_MSG0, diSetupType.szMessage0);

      if(diSetupType.stSetupType0.bVisible)
      {
        WinSetDlgItemText(hDlg, IDC_RADIO_ST0, diSetupType.stSetupType0.szDescriptionShort);
        WinSetDlgItemText(hDlg, IDC_STATIC_ST0_DESCRIPTION, diSetupType.stSetupType0.szDescriptionLong);
        WinShowWindow(hRadioSt0, TRUE);
        WinShowWindow(hStaticSt0, TRUE);
      }
      else
      {
        WinShowWindow(hRadioSt0, FALSE);
        WinShowWindow(hStaticSt0, FALSE);
      }

      if(diSetupType.stSetupType1.bVisible)
      {
        WinSetDlgItemText(hDlg, IDC_RADIO_ST1, diSetupType.stSetupType1.szDescriptionShort);
        WinSetDlgItemText(hDlg, IDC_STATIC_ST1_DESCRIPTION, diSetupType.stSetupType1.szDescriptionLong);
        WinShowWindow(hRadioSt1, TRUE);
        WinShowWindow(hStaticSt1, TRUE);
      }
      else
      {
        WinShowWindow(hRadioSt1, FALSE);
        WinShowWindow(hStaticSt1, FALSE);
      }

      if(diSetupType.stSetupType2.bVisible)
      {
        WinSetDlgItemText(hDlg, IDC_RADIO_ST2, diSetupType.stSetupType2.szDescriptionShort);
        WinSetDlgItemText(hDlg, IDC_STATIC_ST2_DESCRIPTION, diSetupType.stSetupType2.szDescriptionLong);
        WinShowWindow(hRadioSt2, TRUE);
        WinShowWindow(hStaticSt2, TRUE);
      }
      else
      {
        WinShowWindow(hRadioSt2, FALSE);
        WinShowWindow(hStaticSt2, FALSE);
      }

      if(diSetupType.stSetupType3.bVisible)
      {
        WinSetDlgItemText(hDlg, IDC_RADIO_ST3, diSetupType.stSetupType3.szDescriptionShort);
        WinSetDlgItemText(hDlg, IDC_STATIC_ST3_DESCRIPTION, diSetupType.stSetupType3.szDescriptionLong);
        WinShowWindow(hRadioSt3, TRUE);
        WinShowWindow(hStaticSt3, TRUE);
      }
      else
      {
        WinShowWindow(hRadioSt3, FALSE);
        WinShowWindow(hStaticSt3, FALSE);
      }

      /* enable the appropriate radio button */
      switch(ulTempSetupType)
      {
        case ST_RADIO0:
          WinCheckButton(hDlg, IDC_RADIO_ST0, 1);
          WinSetFocus(HWND_DESKTOP, hRadioSt0);
          break;

        case ST_RADIO1:
          WinCheckButton(hDlg, IDC_RADIO_ST1, 1);
          WinSetFocus(HWND_DESKTOP, hRadioSt1);
          break;

        case ST_RADIO2:
          WinCheckButton(hDlg, IDC_RADIO_ST2, 1);
          WinSetFocus(HWND_DESKTOP, hRadioSt2);
          break;

        case ST_RADIO3:
          WinCheckButton(hDlg, IDC_RADIO_ST3, 1);
          WinSetFocus(HWND_DESKTOP, hRadioSt3);
          break;
      }

      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      strcpy(szBuf, szSetupDir);
      AppendBackSlash(szBuf, sizeof(szBuf));
      strcat(szBuf, diSetupType.szReadmeFilename);
      if((*diSetupType.szReadmeFilename == '\0') || (FileExists(szBuf) == FALSE))
        WinShowWindow(hReadme, FALSE);
      else
        WinShowWindow(hReadme, TRUE);

      WinSetDlgItemText(hDlg, IDC_DESTINATION, sgInstallGui.szDestinationDirectory);
      WinSetDlgItemText(hDlg, IDC_BUTTON_BROWSE, sgInstallGui.szBrowse_);
      WinSetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
      WinSetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);
      WinSetDlgItemText(hDlg, IDC_README, sgInstallGui.szReadme_);

      if(sgProduct.bLockPath)
        WinEnableWindow(WinWindowFromID(hDlg, IDC_BUTTON_BROWSE), FALSE);
      else
        WinEnableWindow(WinWindowFromID(hDlg, IDC_BUTTON_BROWSE), TRUE);

      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDC_BUTTON_BROWSE:
          if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_ST0)      == 1)
            ulTempSetupType = ST_RADIO0;
          else if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_ST1) == 1)
            ulTempSetupType = ST_RADIO1;
          else if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_ST2) == 1)
            ulTempSetupType = ST_RADIO2;
          else if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_ST3) == 1)
            ulTempSetupType = ST_RADIO3;

          BrowseForDirectory(hDlg, szTempSetupPath);

          hDestinationPath = WinWindowFromID(hDlg, IDC_EDIT_DESTINATION); /* handle to the static destination path text window */
          TruncateString(hDestinationPath, szTempSetupPath, szBuf, sizeof(szBuf));
          WinSetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szBuf);
          return (MRESULT)TRUE;
          break;

        case IDC_README:
          {
          char fullReadme[CCHMAXPATH];
          strcpy(fullReadme, szSetupDir);
          strcat(fullReadme, diSetupType.szReadmeFilename);

          if(*diSetupType.szReadmeApp == '\0')
            WinSpawn(diSetupType.szReadmeFilename, NULL, szSetupDir, FALSE);
          else
            WinSpawn(diSetupType.szReadmeApp, fullReadme, szSetupDir, FALSE);
          }
          return (MRESULT)TRUE;
          break;

        case IDWIZNEXT:
          strcpy(sgProduct.szPath, szTempSetupPath);

          strcpy(szBuf, sgProduct.szPath);

          if (isFAT(szBuf)) {
            GetPrivateProfileString("Messages", "ERROR_FILESYSTEM", "", szBuf, sizeof(szBuf), szFileIniInstall);
            WinMessageBox(HWND_DESKTOP, hDlg, szBuf, NULL, 0, MB_OK | MB_ICONEXCLAMATION);
            return (MRESULT)TRUE;
          }

          hresult = FileExists(szBuf);
          if ((hresult == TRUE) && (hresult != FILE_DIRECTORY))
          {
            char szEDestinationPath[MAX_BUF];

            GetPrivateProfileString("Messages", "ERROR_DESTINATION_PATH", "", szEDestinationPath, sizeof(szEDestinationPath), szFileIniInstall);
            WinMessageBox(HWND_DESKTOP, hDlg, szEDestinationPath, NULL, 0, MB_OK | MB_ICONEXCLAMATION);
            return (MRESULT)TRUE;
          }

          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))
            {
              strcpy(szBufTemp, "\n\n");
              strcat(szBufTemp, szBuf);
              RemoveBackSlash(szBufTemp);
              strcat(szBufTemp, "\n\n");
              sprintf(szBufTemp2, szMsgCreateDirectory, szBufTemp);
            }

            if(WinMessageBox(HWND_DESKTOP, hDlg, szBufTemp2, szStrCreateDirectory, 0, MB_YESNO | MB_ICONQUESTION) == MBID_YES)
            {
              char szBuf2[MAX_PATH];

              /* append a backslash to the path because CreateDirectoriesAll()
                 uses a backslash to determine directories */
              AppendBackSlash(szBuf, sizeof(szBuf));
              if(CreateDirectoriesAll(szBuf, TRUE) == FALSE)
              {
                char szECreateDirectory[MAX_BUF];

                strcpy(szBufTemp, "\n\n");
                strcat(szBufTemp, sgProduct.szPath);
                RemoveBackSlash(szBufTemp);
                strcat(szBufTemp, "\n\n");

                if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall))
                  sprintf(szBuf, szECreateDirectory, szBufTemp);

                WinMessageBox(HWND_DESKTOP, hDlg, szBuf, "", 0, MB_OK | MB_ERROR);
                return (MRESULT)TRUE;
              }

              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 */
                strcpy(szBuf2, szBuf);
                AppendBackSlash(szBuf2, sizeof(szBuf2));
                strcat(szBuf2, sgProduct.szSubPath);
                UpdateInstallLog(KEY_CREATE_FOLDER, szBuf2, FALSE);
              }

              bCreateDestinationDir = TRUE;
            }
            else
            {
              return (MRESULT)TRUE;
            }
          }

          /* retrieve and save the state of the selected radio button */
          if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_ST0)      == 1)
          {
            SiCNodeSetItemsSelected(ST_RADIO0);

            ulSetupType     = ST_RADIO0;
            ulTempSetupType = ulSetupType;
          }
          else if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_ST1) == 1)
          {
            SiCNodeSetItemsSelected(ST_RADIO1);

            ulSetupType     = ST_RADIO1;
            ulTempSetupType = ulSetupType;
          }
          else if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_ST2) == 1)
          {
            SiCNodeSetItemsSelected(ST_RADIO2);

            ulSetupType     = ST_RADIO2;
            ulTempSetupType = ulSetupType;
          }
          else if(WinQueryButtonCheckstate(hDlg, IDC_RADIO_ST3) == 1)
          {
            SiCNodeSetItemsSelected(ST_RADIO3);

            ulSetupType     = ST_RADIO3;
            ulTempSetupType = ulSetupType;
          }

          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
          ulTempSetupType = ulSetupType;
          strcpy(sgProduct.szPath, szTempSetupPath);
          WinDestroyWindow(hDlg);
          DlgSequence(PREV_DLG);
          break;

        case IDCANCEL:
          AskCancelDlg(hDlg);
          return (MRESULT)TRUE;
          break;

        default:
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

LRESULT CALLBACK DlgProcSiteSelector ( HWND  hDlg,
UINT  msg,
WPARAM  wParam,
LONG  lParam 
)
MRESULT EXPENTRY DlgProcStartInstall ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 2010 of file dialogs.c.

{
  SWP   swpDlg;
  LPSTR szMessage = NULL;

  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      WinSetWindowText(hDlg, diStartInstall.szTitle);

      WinSetDlgItemText(hDlg, IDC_STATIC, sgInstallGui.szCurrentSettings);
      WinSetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szInstall_);
      WinSetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);
 
      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);

      if((diAdvancedSettings.bShowDialog == FALSE) || (GetTotalArchivesToDownload() == 0))
      {
        WinShowWindow(WinWindowFromID(hDlg, IDC_BUTTON_SITE_SELECTOR), FALSE);
        WinSetDlgItemText(hDlg, IDC_MESSAGE0, diStartInstall.szMessageInstall);
      }
      else
      {
        WinShowWindow(WinWindowFromID(hDlg, IDC_BUTTON_SITE_SELECTOR), TRUE);
        WinSetDlgItemText(hDlg, IDC_MESSAGE0, diStartInstall.szMessageDownload);
      }

      if((szMessage = GetStartInstallMessage()) != NULL)
      {
        WinSetDlgItemText(hDlg, IDC_CURRENT_SETTINGS, szMessage);
        FreeMemory(&szMessage);
      }

      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDWIZNEXT:
          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case IDWIZBACK:
          WinDestroyWindow(hDlg);
          DlgSequence(PREV_DLG);
          break;

        case IDCANCEL:
          AskCancelDlg(hDlg);
          return (MRESULT)TRUE;
          break;

        default:
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

Here is the caller graph for this function:

LRESULT CALLBACK DlgProcUpgrade ( HWND  hDlg,
UINT  msg,
WPARAM  wParam,
LONG  lParam 
)

Definition at line 873 of file dialogs.c.

{
  LPNMHDR notifyMessage;
  BOOL pathInWinDir = FALSE;
  BOOL rv = FALSE;

  switch (msg) {
  case WM_INITDIALOG:
    SetDlgItemText(hDlg, IDC_MESSAGE_UPGRADE, diUpgrade.szMessageCleanup);
    SetDlgItemText(hDlg, IDC_CHECK_SAFE_INSTALL, diUpgrade.szCheckboxSafeInstall);

    SendDlgItemMessage(hDlg, IDC_MESSAGE_UPGRADE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
    SendDlgItemMessage(hDlg, IDC_CHECK_SAFE_INSTALL, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);

    // Default to "Safe Upgrade".
    CheckDlgButton(hDlg, IDC_CHECK_SAFE_INSTALL, BST_CHECKED);

    break;

  case WM_COMMAND:
    switch (LOWORD(wParam)) {
    case IDC_CHECK_SAFE_INSTALL:
      UpdateUpgradeModeMessage(hDlg);
      
      break;
    }

    break;

  case WM_NOTIFY:
    notifyMessage = (LPNMHDR)lParam;

    switch (notifyMessage->code) {
    case PSN_SETACTIVE:
      // Wizard dialog title
      PropSheet_SetTitle(GetParent(hDlg), 0, (LPTSTR)diUpgrade.szTitle); 

      InitPathDisplay(hDlg, sgProduct.szPath, IDC_FOLDER_ICON, IDC_EDIT_DESTINATION);

      pathInWinDir = IsPathWithinWindir(sgProduct.szPath);
      if(pathInWinDir) {
        // Do not clean up 
        sgProduct.doCleanupOnUpgrade = FALSE;

        // Disable UI and show an explanation. 
        EnableWindow(GetDlgItem(hDlg, IDC_CHECK_SAFE_INSTALL), FALSE);
        SetDlgItemText(hDlg, IDC_MESSAGE_INFO, diUpgrade.szNoSafeUpgradeWindir);
      }

      CheckDlgButton(hDlg, IDC_CHECK_SAFE_INSTALL, sgProduct.doCleanupOnUpgrade ? BST_CHECKED : BST_UNCHECKED);
      
      if (!pathInWinDir)
        UpdateUpgradeModeMessage(hDlg);

      PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_NEXT|PSWIZB_BACK);

      break;

    case PSN_WIZNEXT:
      if (dwSetupType == ST_RADIO0) {
        SetWindowLong(hDlg, DWL_MSGRESULT, DLG_START_INSTALL);
        rv = TRUE;
      }

      sgProduct.doCleanupOnUpgrade = IsDlgButtonChecked(hDlg, IDC_CHECK_SAFE_INSTALL) == BST_CHECKED;

      SiCNodeSetItemsSelected(dwSetupType);

      break;

    case PSN_WIZBACK:
      if (dwSetupType == ST_RADIO0) {
        SetWindowLong(hDlg, DWL_MSGRESULT, DLG_SETUP_TYPE);
        rv = TRUE;
      }

      sgProduct.doCleanupOnUpgrade = IsDlgButtonChecked(hDlg, IDC_CHECK_SAFE_INSTALL) == BST_CHECKED;

      SiCNodeSetItemsSelected(dwSetupType);

      break;

    case PSN_QUERYCANCEL:
      return !ShouldExitSetup(hDlg);
    }

    break;
  
  }
  return rv;
}
MRESULT EXPENTRY DlgProcWelcome ( HWND  hDlg,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 159 of file dialogs.c.

{
  BOOL rc;
  char szBuf[MAX_BUF];
  SWP  swpDlg;
  
  switch(msg)
  {
    case WM_INITDLG:
      AdjustDialogSize(hDlg);
      WinSetPresParam(hDlg, PP_FONTNAMESIZE,
                      strlen(sgInstallGui.szDefinedFont)+1, sgInstallGui.szDefinedFont);
      /* Initialize controls */
      WinSetWindowText(hDlg, diWelcome.szTitle);
      sprintf(szBuf, diWelcome.szMessage0, sgProduct.szProductName, sgProduct.szProductName);
      strcat(szBuf, "\n\n");
      strcat(szBuf, diWelcome.szMessage1);
      strcat(szBuf, "\n\n");
      strcat(szBuf, diWelcome.szMessage2);
      WinSetDlgItemText(hDlg, IDC_STATIC0, szBuf);
//      WinSetDlgItemText(hDlg, IDC_STATIC1, diWelcome.szMessage1);
//      WinSetDlgItemText(hDlg, IDC_STATIC2, diWelcome.szMessage2);
      WinSetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);
      WinSetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);

      /* Center dialog */
      WinQueryWindowPos(hDlg, &swpDlg);
      WinSetWindowPos(hDlg,
                      HWND_TOP,
                      (gSystemInfo.lScreenX/2)-(swpDlg.cx/2),
                      (gSystemInfo.lScreenY/2)-(swpDlg.cy/2),
                      0,
                      0,
                      SWP_MOVE);
      break;

    case WM_CLOSE:
      AskCancelDlg(hDlg);
      return (MRESULT)TRUE;
      break;

    case WM_COMMAND:
      switch ( SHORT1FROMMP( mp1 ) )
      {
        case IDWIZNEXT:
          WinDestroyWindow(hDlg);
          DlgSequence(NEXT_DLG);
          break;

        case DID_CANCEL:
          AskCancelDlg(hDlg);
          return (MRESULT)TRUE;
          break;

        default:
          break;
      }
      break;
  }
  return(WinDefDlgProc(hDlg, msg, mp1, mp2));
}

Here is the call graph for this function:

void DlgSequence ( int  iDirection)

Definition at line 2332 of file dialogs.c.

{
  HRESULT hrValue;
  BOOL    bDone = FALSE;

  do
  {
    gbProcessingXpnstallFiles = FALSE;

    if(iDirection == NEXT_DLG)
    {
      switch(ulWizardState)
      {
        case DLG_NONE:
          ulWizardState = DLG_WELCOME;
          break;
        case DLG_WELCOME:
          ulWizardState = DLG_LICENSE;
          break;
        case DLG_LICENSE:
          ulWizardState = DLG_SETUP_TYPE;
          break;
        case DLG_SETUP_TYPE:
          ulWizardState = DLG_SELECT_COMPONENTS;
          break;
        case DLG_SELECT_COMPONENTS:
          ulWizardState = DLG_SELECT_ADDITIONAL_COMPONENTS;
          break;
        case DLG_SELECT_ADDITIONAL_COMPONENTS:
          ulWizardState = DLG_OS2_INTEGRATION;
          break;
        case DLG_OS2_INTEGRATION:
          ulWizardState = DLG_ADDITIONAL_OPTIONS;
          break;
        case DLG_ADDITIONAL_OPTIONS:
          ulWizardState = DLG_START_INSTALL;
          break;
        case DLG_START_INSTALL:
          ulWizardState = DLG_COMMIT_INSTALL;
          break;

        case DLG_ADVANCED_SETTINGS:
          ulWizardState = DLG_ADDITIONAL_OPTIONS;
          break;

        default:
          ulWizardState = DLG_WELCOME;
          break;      }
    }
    else if(iDirection == PREV_DLG)
    {
      switch(ulWizardState)
      {
        case DLG_LICENSE:
          ulWizardState = DLG_WELCOME;
          break;
        case DLG_SETUP_TYPE:
          ulWizardState = DLG_LICENSE;
          break;
        case DLG_SELECT_COMPONENTS:
          ulWizardState = DLG_SETUP_TYPE;
          break;
        case DLG_SELECT_ADDITIONAL_COMPONENTS:
          ulWizardState = DLG_SELECT_COMPONENTS;
          break;
        case DLG_OS2_INTEGRATION:
          ulWizardState = DLG_SELECT_ADDITIONAL_COMPONENTS;
          break;
        case DLG_ADDITIONAL_OPTIONS:
          ulWizardState = DLG_OS2_INTEGRATION;
          break;
        case DLG_START_INSTALL:
          ulWizardState = DLG_ADDITIONAL_OPTIONS;
          break;

        case DLG_ADVANCED_SETTINGS:
          ulWizardState = DLG_ADDITIONAL_OPTIONS;
          break;

        default:
          ulWizardState = DLG_WELCOME;
          break;
      }
    }
    else if(iDirection == OTHER_DLG_1)
    {
      switch(ulWizardState)
      {
        case DLG_ADDITIONAL_OPTIONS:
          ulWizardState = DLG_ADVANCED_SETTINGS;
          break;

        // You'll get here only if DLG_ADVANCED_SETTINGS is not displayed, which really should
        //   should never be the case unless DLG_ADDITIONAL_OPTIONS is also not displayed, since this
        //   is a button off that dialog.  But if the user turns this off in error, handling the case
        //   will keep from dropping into an infinite loop.
        case DLG_ADVANCED_SETTINGS:
          ulWizardState = DLG_ADDITIONAL_OPTIONS;
          break;
      }
    }

    switch(ulWizardState)
    {
      case DLG_WELCOME:
        if(diWelcome.bShowDialog)
        {
          hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diWelcome.szTitle, DlgProcWelcome);
          bDone = TRUE;
        }
        break;

      case DLG_LICENSE:
        if(diLicense.bShowDialog)
        {
          hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diLicense.szTitle, DlgProcLicense);
          bDone = TRUE;
        }
        break;

      case DLG_SETUP_TYPE:
        if(diSetupType.bShowDialog)
        {
          hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diSetupType.szTitle, DlgProcSetupType);
          bDone = TRUE;
        }
        break;

      case DLG_SELECT_COMPONENTS:
        if((diSelectComponents.bShowDialog) && (sgProduct.ulCustomType == ulSetupType))
        {
          hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diSelectComponents.szTitle, DlgProcSelectComponents);
          bDone = TRUE;
        }
        break;

      case DLG_SELECT_ADDITIONAL_COMPONENTS:
        if((diSelectAdditionalComponents.bShowDialog) && (sgProduct.ulCustomType == ulSetupType))
        {
          hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diSelectAdditionalComponents.szTitle, DlgProcSelectAdditionalComponents);
          bDone = TRUE;
        }
        break;

      case DLG_OS2_INTEGRATION:
        if(diOS2Integration.bShowDialog)
        {
          hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diOS2Integration.szTitle, DlgProcOS2Integration);
          bDone = TRUE;
        }
        break;

      case DLG_ADVANCED_SETTINGS:
        if(diAdvancedSettings.bShowDialog)
        {
          hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diAdvancedSettings.szTitle, DlgProcAdvancedSettings);
          bDone = TRUE;
        }
        break;

      case DLG_ADDITIONAL_OPTIONS:
        do
        {
          hrValue = VerifyDiskSpace();
          if(hrValue == DID_OK)
          {
            /* show previous visible window */
            iDirection = PREV_DLG;
          }
          else if(hrValue == IDCANCEL)
          {
            AskCancelDlg(hWndMain);
            hrValue = MBID_RETRY;
          }
        }while(hrValue == MBID_RETRY);

        if(hrValue != DID_OK)
        {
          if(ShowAdditionalOptionsDialog() == TRUE)
          {
            hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diAdditionalOptions.szTitle, DlgProcAdditionalOptions);
            bDone = TRUE;
          }
        }
        break;

      case DLG_START_INSTALL:
        if(diStartInstall.bShowDialog)
        {
          hDlgCurrent = InstantiateDialog(hWndMain, ulWizardState, diStartInstall.szTitle, DlgProcStartInstall);
          bDone = TRUE;
        }
        break;

      case DLG_COMMIT_INSTALL:
        gbProcessingXpnstallFiles = TRUE;
        CommitInstall();
        bDone = TRUE;
        break;
    }
  } while(!bDone);
}
void DrawCheck ( LPDRAWITEMSTRUCT  lpdis,
DWORD  dwACFlag 
)

Definition at line 1041 of file dialogs.c.

{
  siC     *siCTemp  = NULL;
  HDC     hdcMem;
  HBITMAP hbmpCheckBox;

  siCTemp = SiCNodeGetObject(lpdis->itemID, FALSE, dwACFlag);
  if(siCTemp != NULL)
  {
    if(!(siCTemp->dwAttributes & SIC_SELECTED))
      /* Component is not selected.  Use the unchecked bitmap regardless if the 
       * component is disabled or not.  The unchecked bitmap looks the same if
       * it's disabled or enabled. */
      hbmpCheckBox = hbmpBoxUnChecked;
    else if(siCTemp->dwAttributes & SIC_DISABLED)
      /* Component is checked and disabled */
      hbmpCheckBox = hbmpBoxCheckedDisabled;
    else
      /* Component is checked and enabled */
      hbmpCheckBox = hbmpBoxChecked;

    SendMessage(lpdis->hwndItem, LB_SETITEMDATA, lpdis->itemID, (LPARAM)hbmpCheckBox);
    if((hdcMem = CreateCompatibleDC(lpdis->hDC)) != NULL)
    {
      SelectObject(hdcMem, hbmpCheckBox);

      // BitBlt() is used to prepare the checkbox icon into the list box item's device context.
      // The SendMessage() function using LB_SETITEMDATA performs the drawing.
      BitBlt(lpdis->hDC,
             lpdis->rcItem.left + 2,
             lpdis->rcItem.top + 2,
             lpdis->rcItem.right - lpdis->rcItem.left,
             lpdis->rcItem.bottom - lpdis->rcItem.top,
             hdcMem,
             0,
             0,
             SRCCOPY);

      DeleteDC(hdcMem);
    }
  }
}
void DrawLBText ( LPDRAWITEMSTRUCT  lpdis,
DWORD  dwACFlag 
)

Definition at line 969 of file dialogs.c.

{
  siC     *siCTemp  = NULL;
  TCHAR   tchBuffer[MAX_BUF];
  TEXTMETRIC tm;
  DWORD      y;

  siCTemp = SiCNodeGetObject(lpdis->itemID, FALSE, dwACFlag);
  if(siCTemp != NULL)
  {
    SendMessage(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, (LPARAM)tchBuffer);

    if((lpdis->itemAction & ODA_FOCUS) && (lpdis->itemState & ODS_SELECTED))
    {
      // remove the focus rect on the previous selected item
      DrawFocusRect(lpdis->hDC, &(lpdis->rcItem));
    }

    siCTemp = SiCNodeGetObject(lpdis->itemID, FALSE, dwACFlag);
    if(lpdis->itemAction & ODA_FOCUS)
    {
      if((lpdis->itemState & ODS_SELECTED) &&
        !(lpdis->itemState & ODS_FOCUS))
      {
        if(siCTemp->dwAttributes & SIC_DISABLED)
          SetTextColor(lpdis->hDC,        GetSysColor(COLOR_GRAYTEXT));
        else
        {
          SetTextColor(lpdis->hDC,        GetSysColor(COLOR_WINDOWTEXT));
          SetBkColor(lpdis->hDC,          GetSysColor(COLOR_WINDOW));
        }
      }
      else
      {
        if(siCTemp->dwAttributes & SIC_DISABLED)
          SetTextColor(lpdis->hDC,        GetSysColor(COLOR_GRAYTEXT));
        else
        {
          SetTextColor(lpdis->hDC,        GetSysColor(COLOR_HIGHLIGHTTEXT));
          SetBkColor(lpdis->hDC,          GetSysColor(COLOR_HIGHLIGHT));
        }
      }
    }
    else if(lpdis->itemAction & ODA_DRAWENTIRE)
    {
      if(siCTemp->dwAttributes & SIC_DISABLED)
        SetTextColor(lpdis->hDC, GetSysColor(COLOR_GRAYTEXT));
      else
        SetTextColor(lpdis->hDC, GetSysColor(COLOR_WINDOWTEXT));
    }

    // If a screen reader is being used we want to redraw the text whether
    //   it has focus or not because the text changes whenever the checkbox
    //   changes.
    if( gSystemInfo.bScreenReader || (lpdis->itemAction & (ODA_DRAWENTIRE | ODA_FOCUS)) )
    {
      // Display the text associated with the item.
      GetTextMetrics(lpdis->hDC, &tm);
      y = (lpdis->rcItem.bottom + lpdis->rcItem.top - tm.tmHeight) / 2;

      ExtTextOut(lpdis->hDC,
                 CX_CHECKBOX + 5,
                 y,
                 ETO_OPAQUE | ETO_CLIPPED,
                 &(lpdis->rcItem),
                 tchBuffer,
                 strlen(tchBuffer),
                 NULL);
    }
  }
}

Definition at line 1784 of file dialogs.c.

{
  char  szBuf[MAX_BUF];
  char  szSTRRequired[MAX_BUF_TINY];
  siC   *siCObject   = NULL;
  LPSTR szMessageBuf = NULL;
  DWORD dwBufSize;
  DWORD dwIndex0;

  GetPrivateProfileString("Strings", "STR Force Upgrade Required", "", szSTRRequired, sizeof(szSTRRequired), szFileIniConfig);

  /* calculate the amount of memory to allocate for the buffer */
  dwBufSize = 0;

  /* setup type */
  if(GetPrivateProfileString("Messages", "STR_SETUP_TYPE", "", szBuf, sizeof(szBuf), szFileIniInstall))
    dwBufSize += strlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters
  dwBufSize += 4; // take into account 4 indentation spaces

  switch(ulSetupType)
  {
    case ST_RADIO3:
      dwBufSize += strlen(diSetupType.stSetupType3.szDescriptionShort) + 2; // the extra 2 bytes is for the \r\n characters
      break;

    case ST_RADIO2:
      dwBufSize += strlen(diSetupType.stSetupType2.szDescriptionShort) + 2; // the extra 2 bytes is for the \r\n characters
      break;

    case ST_RADIO1:
      dwBufSize += strlen(diSetupType.stSetupType1.szDescriptionShort) + 2; // the extra 2 bytes is for the \r\n characters
      break;

    default:
      dwBufSize += strlen(diSetupType.stSetupType0.szDescriptionShort) + 2; // the extra 2 bytes is for the \r\n characters
      break;
  }
  dwBufSize += 2; // the extra 2 bytes is for the \r\n characters

  /* selected components */
  if(GetPrivateProfileString("Messages", "STR_SELECTED_COMPONENTS", "", szBuf, sizeof(szBuf), szFileIniInstall))
    dwBufSize += strlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters

  dwIndex0 = 0;
  siCObject = SiCNodeGetObject(dwIndex0, FALSE, AC_ALL);
  while(siCObject)
  {
    if(siCObject->dwAttributes & SIC_SELECTED)
    {
      dwBufSize += 4; // take into account 4 indentation spaces
      dwBufSize += strlen(siCObject->szDescriptionShort);
    }

    if(siCObject->bForceUpgrade)
    {
      /* add the "(Required)" string (or something equivalent) after the component description */
      if(*szSTRRequired != '\0')
      {
        dwBufSize += 1; // space after the short description
        dwBufSize += strlen(szSTRRequired);
      }
    }

    if(siCObject->dwAttributes & SIC_SELECTED)
      dwBufSize += 2; // the extra 2 bytes is for the \r\n characters

    ++dwIndex0;
    siCObject = SiCNodeGetObject(dwIndex0, FALSE, AC_ALL);
  }
  dwBufSize += 2; // the extra 2 bytes is for the \r\n characters

  /* destination path */
  if(GetPrivateProfileString("Messages", "STR_DESTINATION_DIRECTORY", "", szBuf, sizeof(szBuf), szFileIniInstall))
    dwBufSize += strlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters

  dwBufSize += 4; // take into account 4 indentation spaces
  dwBufSize += strlen(sgProduct.szPath) + 2; // the extra 2 bytes is for the \r\n characters
  dwBufSize += 2; // the extra 2 bytes is for the \r\n characters

  if(GetTotalArchivesToDownload() > 0)
  {
    dwBufSize += 2; // the extra 2 bytes is for the \r\n characters

    /* site selector info */
    if(GetPrivateProfileString("Messages", "STR_DOWNLOAD_SITE", "", szBuf, sizeof(szBuf), szFileIniInstall))
      dwBufSize += strlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters

    dwBufSize += 4; // take into account 4 indentation spaces
    dwBufSize += strlen(szSiteSelectorDescription) + 2; // the extra 2 bytes is for the \r\n characters

    if(diAdditionalOptions.bSaveInstaller)
    {
      dwBufSize += 2; // the extra 2 bytes is for the \r\n characters

      /* site selector info */
      if(GetPrivateProfileString("Messages", "STR_SAVE_INSTALLER_FILES", "", szBuf, sizeof(szBuf), szFileIniInstall))
        dwBufSize += strlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters

      GetSaveInstallerPath(szBuf, sizeof(szBuf));
      dwBufSize += 4; // take into account 4 indentation spaces
      dwBufSize += strlen(szBuf) + 2; // the extra 2 bytes is for the \r\n characters
    }
  }

  dwBufSize += 1; // take into account the null character


  /* From here down, the buffer is created given the above calculated buffer size.  If the 
   * string concatenation (addition) is changed below, then the buffer size calculation above
   * needs to be changed accordingly! */

  /* allocate the memory */
  if((szMessageBuf = NS_GlobalAlloc(dwBufSize)) != NULL)
  {
    memset(szMessageBuf, 0, dwBufSize);

    /* Setup Type */
    if(GetPrivateProfileString("Messages", "STR_SETUP_TYPE", "", szBuf, sizeof(szBuf), szFileIniInstall))
    {
      strcat(szMessageBuf, szBuf);
      strcat(szMessageBuf, "\r\n");
    }
    strcat(szMessageBuf, "    "); // add 4 indentation spaces
      
    switch(ulSetupType)
    {
      case ST_RADIO3:
        AppendStringWOTilde(szMessageBuf, dwBufSize, diSetupType.stSetupType3.szDescriptionShort);
        break;

      case ST_RADIO2:
        AppendStringWOTilde(szMessageBuf, dwBufSize, diSetupType.stSetupType2.szDescriptionShort);
        break;

      case ST_RADIO1:
        AppendStringWOTilde(szMessageBuf, dwBufSize, diSetupType.stSetupType1.szDescriptionShort);
        break;

      default:
        AppendStringWOTilde(szMessageBuf, dwBufSize, diSetupType.stSetupType0.szDescriptionShort);
        break;
    }
    strcat(szMessageBuf, "\r\n\r\n");

    /* Selected Components */
    if(GetPrivateProfileString("Messages", "STR_SELECTED_COMPONENTS", "", szBuf, sizeof(szBuf), szFileIniInstall))
    {
      strcat(szMessageBuf, szBuf);
      strcat(szMessageBuf, "\r\n");
    }

    dwIndex0  = 0;
    siCObject = SiCNodeGetObject(dwIndex0, FALSE, AC_ALL);
    while(siCObject)
    {
      if(siCObject->dwAttributes & SIC_SELECTED)
      {
        strcat(szMessageBuf, "    "); // add 4 indentation spaces
        strcat(szMessageBuf, siCObject->szDescriptionShort);
      }

      if(siCObject->bForceUpgrade)
      {
        /* add the "(Required)" string (or something equivalent) after the component description */
        if(*szSTRRequired != '\0')
        {
          strcat(szMessageBuf, " "); // add 1 space
          strcat(szMessageBuf, szSTRRequired);
        }
      }

      if(siCObject->dwAttributes & SIC_SELECTED)
        strcat(szMessageBuf, "\r\n");

      ++dwIndex0;
      siCObject = SiCNodeGetObject(dwIndex0, FALSE, AC_ALL);
    }
    strcat(szMessageBuf, "\r\n");

    /* destination directory */
    if(GetPrivateProfileString("Messages", "STR_DESTINATION_DIRECTORY", "", szBuf, sizeof(szBuf), szFileIniInstall))
    {
      strcat(szMessageBuf, szBuf);
      strcat(szMessageBuf, "\r\n");
    }
    strcat(szMessageBuf, "    "); // add 4 indentation spaces
    strcat(szMessageBuf, sgProduct.szPath);
    strcat(szMessageBuf, "\r\n\r\n");

    if(GetTotalArchivesToDownload() > 0)
    {
      strcat(szMessageBuf, "\r\n");

      /* site selector info */
      if(GetPrivateProfileString("Messages", "STR_DOWNLOAD_SITE", "", szBuf, sizeof(szBuf), szFileIniInstall))
      {
        strcat(szMessageBuf, szBuf);
        strcat(szMessageBuf, "\r\n");
      }

      strcat(szMessageBuf, "    "); // add 4 indentation spaces
      strcat(szMessageBuf, szSiteSelectorDescription); // site selector description
      strcat(szMessageBuf, "\r\n");

      if(diAdditionalOptions.bSaveInstaller)
      {
        strcat(szMessageBuf, "\r\n");

        /* site selector info */
        if(GetPrivateProfileString("Messages", "STR_SAVE_INSTALLER_FILES", "", szBuf, sizeof(szBuf), szFileIniInstall))
        {
          strcat(szMessageBuf, szBuf);
          strcat(szMessageBuf, "\r\n");
        }

        GetSaveInstallerPath(szBuf, sizeof(szBuf));
        strcat(szMessageBuf, "    "); // add 4 indentation spaces
        strcat(szMessageBuf, szBuf);
        strcat(szMessageBuf, "\r\n");
      }
    }
  }

  return(szMessageBuf);
}
HWND InstantiateDialog ( HWND  hParent,
ULONG  ulDlgID,
PSZ  szTitle,
PFNWP  pfnwpDlgProc 
)

Definition at line 2347 of file dialogs.c.

{
  char szBuf[MAX_BUF];
  HWND hDlg = NULL;


  if((hDlg = CreateDialog(hSetupRscInst, MAKEINTRESOURCE(dwDlgID), hParent, wpDlgProc)) == NULL)
  {
    char szEDialogCreate[MAX_BUF];

    if(GetPrivateProfileString("Messages", "ERROR_DIALOG_CREATE", "", szEDialogCreate, sizeof(szEDialogCreate), szFileIniInstall))
    {
      wsprintf(szBuf, szEDialogCreate, szTitle);
      PrintError(szBuf, ERROR_CODE_SHOW);
    }
    PostQuitMessage(1);
  }

  return(hDlg);
}
void InvalidateLBCheckbox ( HWND  hwndListBox)

Definition at line 1108 of file dialogs.c.

{
  RECT rcCheckArea;

  // retrieve the rectangle of all list items to update.
  GetClientRect(hwndListBox, &rcCheckArea);

  // Set the right coordinate of the rectangle to be the same
  //   as the right edge of the bitmap drawn.
  // But if a screen reader is being used we want to redraw the text
  //   as well as the checkbox so we do not set the right coordinate.
  if(!gSystemInfo.bScreenReader)
    rcCheckArea.right = CX_CHECKBOX;

  // It then invalidates the checkbox region to be redrawn.
  // Invalidating the region sends a WM_DRAWITEM message to
  // the dialog, which redraws the region given the
  // node attirbute, in this case it is a bitmap of a
  // checked/unchecked checkbox.
  InvalidateRect(hwndListBox, &rcCheckArea, TRUE);
}
void lbAddItem ( HWND  hList,
siC *  siCComponent 
)

Definition at line 1084 of file dialogs.c.

{
  DWORD dwItem;
  TCHAR tchBuffer[MAX_BUF];

  lstrcpy(tchBuffer, siCComponent->szDescriptionShort);
  if(gSystemInfo.bScreenReader)
  {
    lstrcat(tchBuffer, " - ");
    if(!(siCComponent->dwAttributes & SIC_SELECTED))
      lstrcat(tchBuffer, sgInstallGui.szUnchecked);
    else
      lstrcat(tchBuffer, sgInstallGui.szChecked);
  }
  dwItem = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)tchBuffer);

  if(siCComponent->dwAttributes & SIC_DISABLED)
    SendMessage(hList, LB_SETITEMDATA, dwItem, (LPARAM)hbmpBoxCheckedDisabled);
  else if(siCComponent->dwAttributes & SIC_SELECTED)
    SendMessage(hList, LB_SETITEMDATA, dwItem, (LPARAM)hbmpBoxChecked);
  else
    SendMessage(hList, LB_SETITEMDATA, dwItem, (LPARAM)hbmpBoxUnChecked);
} 
LRESULT CALLBACK ListBoxBrowseWndProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 455 of file dialogs.c.

{
  switch(uMsg)
  {
    case LB_SETCURSEL:
      gdwIndexLastSelected = (DWORD)wParam;
      break;
  }

  return(CallWindowProc(OldBrowseWndProc, hWnd, uMsg, wParam, lParam));
}
MRESULT EXPENTRY NewListBoxWndProc ( HWND  ,
ULONG  ,
MPARAM  ,
MPARAM   
)

Definition at line 1022 of file dialogs.c.

{
  POINTS ptspointerpos;
  USHORT fsflags;
  ULONG ulIndex;
  
  switch(msg)
  {
    case WM_CHAR:
      fsflags = SHORT1FROMMP(mp1);
      if (SHORT2FROMMP(mp2) == VK_SPACE) {
        if (!(fsflags & KC_KEYUP)) {
          ulIndex = WinSendMsg(hWnd,
                               LM_QUERYSELECTION,
                               0,
                               0);
          ToggleCheck(hWnd, ulIndex, gdwACFlag);
        }
      }
      break;

    case WM_BUTTON1DOWN:
      ptspointerpos.x = SHORT1FROMMP(mp1);
      ptspointerpos.y = SHORT2FROMMP(mp1);

      if((ptspointerpos.x >= 0) && (ptspointerpos.x <= CX_CHECKBOX+4+4))
      {
        MRESULT mr = (OldListBoxWndProc)(hWnd, msg, mp1, mp2);
        ulIndex = WinSendMsg(hWnd, LM_QUERYSELECTION, LIT_FIRST, 0);
        ToggleCheck(hWnd, ulIndex, gdwACFlag);
        return mr;
      }
      break;
  }

  return(OldListBoxWndProc)(hWnd, msg, mp1, mp2);
}

Here is the call graph for this function:

void PaintGradientShade ( HWND  hWnd,
HDC  hdc 
)

Definition at line 2336 of file dialogs.c.

{
  MSG msg;

  while(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
  {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  }
}
void SaveAdditionalOptions ( HWND  hDlg,
HWND  hwndCBSiteSelector 
)

Definition at line 1599 of file dialogs.c.

{
  int iIndex;

  /* get selected item from the site selector's pull down list */
  iIndex = WinSendMsg(hwndCBSiteSelector, LM_QUERYSELECTION, 0, 0);
  WinSendMsg(hwndCBSiteSelector, LM_QUERYITEMTEXT, MPFROM2SHORT(iIndex, MAX_BUF), (MPARAM)szSiteSelectorDescription);

  /* get the state of the Save Installer Files checkbox */
  if(WinQueryButtonCheckstate(hDlg, IDC_CHECK_SAVE_INSTALLER_FILES) == 1)
    diAdditionalOptions.bSaveInstaller = TRUE;
  else
    diAdditionalOptions.bSaveInstaller = FALSE;

  /* get the state of the Recapture Homepage checkbox */
  if(WinQueryButtonCheckstate(hDlg, IDC_CHECK_RECAPTURE_HOMEPAGE) == 1)
    diAdditionalOptions.bRecaptureHomepage = TRUE;
  else
    diAdditionalOptions.bRecaptureHomepage = FALSE;
}
void ShowMessage ( PSZ  szMessage,
BOOL  bShow 
)

Definition at line 2312 of file dialogs.c.

{
  if(sgProduct.mode != SILENT)
  {
    if(bShow && szMessage)
    {
      char szBuf[MAX_BUF];
 
      ZeroMemory(szBuf, sizeof(szBuf));
      GetPrivateProfileString("Messages", "MB_MESSAGE_STR", "", szBuf, sizeof(szBuf), szFileIniInstall);
      hDlgMessage = InstantiateDialog(hWndMain, DLG_MESSAGE, szBuf, DlgProcMessage);
      SendMessage(hDlgMessage, WM_COMMAND, IDC_MESSAGE, (LPARAM)szMessage);
    }
    else
    {
      DestroyWindow(hDlgMessage);
      hDlgMessage = NULL;
    }
  }
}
WNDPROC SubclassWindow ( HWND  hWnd,
WNDPROC  NewWndProc 
)

Definition at line 1169 of file dialogs.c.

{
  WNDPROC OldWndProc;

  OldWndProc = (WNDPROC)GetWindowLong(hWnd, GWL_WNDPROC);
  SetWindowLong(hWnd, GWL_WNDPROC, (LONG) NewWndProc);

  return OldWndProc;
}
void ToggleCheck ( HWND  hwndListBox,
DWORD  dwIndex,
DWORD  dwACFlag 
)

Definition at line 1130 of file dialogs.c.

{
  BOOL  bMoreToResolve;
  LPSTR szToggledReferenceName = NULL;
  DWORD dwAttributes;

  // Checks to see if the checkbox is checked or not checked, and
  // toggles the node attributes appropriately.
  dwAttributes = SiCNodeGetAttributes(dwIndex, FALSE, dwACFlag);
  if(!(dwAttributes & SIC_DISABLED))
  {
    if(dwAttributes & SIC_SELECTED)
    {
      SiCNodeSetAttributes(dwIndex, SIC_SELECTED, FALSE, FALSE, dwACFlag, hwndListBox);

      szToggledReferenceName = SiCNodeGetReferenceName(dwIndex, FALSE, dwACFlag);
      ResolveDependees(szToggledReferenceName, hwndListBox);
    }
    else
    {
      SiCNodeSetAttributes(dwIndex, SIC_SELECTED, TRUE, FALSE, dwACFlag, hwndListBox);
      bMoreToResolve = ResolveDependencies(dwIndex, hwndListBox);

      while(bMoreToResolve)
        bMoreToResolve = ResolveDependencies(-1, hwndListBox);

      szToggledReferenceName = SiCNodeGetReferenceName(dwIndex, FALSE, dwACFlag);
      ResolveDependees(szToggledReferenceName, hwndListBox);
    }

    InvalidateLBCheckbox(hwndListBox);
  }
}
void TruncateString ( HWND  hWnd,
LPSTR  szInPath,
LPSTR  szOutPath,
DWORD  dwOutPathBufSize 
)

Definition at line 2368 of file dialogs.c.

{
  HDC           hdcWnd;
  LOGFONT       logFont;
  HFONT         hfontNew;
  HFONT         hfontOld;
  RECT          rWndRect;
  SIZE          sizeString;
  char          *ptr = NULL;
  int           iHalfLen;
  int           iOutStringLen;

  if((DWORD)lstrlen(szInURL) > dwOutStringBufSize)
    return;

  ZeroMemory(szOutString, dwOutStringBufSize);
  lstrcpy(szOutString, szInURL);
  iOutStringLen = lstrlen(szOutString);
  hdcWnd        = GetWindowDC(hWnd);
  GetClientRect(hWnd, &rWndRect);
  SystemParametersInfo(SPI_GETICONTITLELOGFONT,
                       sizeof(logFont),
                       (PVOID)&logFont,
                       0);

  hfontNew = CreateFontIndirect(&logFont);
  if(hfontNew)
  {
    hfontOld = (HFONT)SelectObject(hdcWnd, hfontNew);

    GetTextExtentPoint32(hdcWnd, szOutString, iOutStringLen, &sizeString);
    while(sizeString.cx > rWndRect.right)
    {
      iHalfLen = iOutStringLen / 2;
      if(iHalfLen == 2)
        break;

      ptr = szOutString + iHalfLen;
      memmove(ptr - 1, ptr, lstrlen(ptr) + 1);
      szOutString[iHalfLen - 2] = '.';
      szOutString[iHalfLen - 1] = '.';
      szOutString[iHalfLen]     = '.';
      iOutStringLen = lstrlen(szOutString);
      GetTextExtentPoint32(hdcWnd, szOutString, iOutStringLen, &sizeString);
    }
  }

  SelectObject(hdcWnd, hfontOld);
  DeleteObject(hfontNew);
  ReleaseDC(hWnd, hdcWnd);
}