RegCloseKey(theKey);
LRESULT CALLBACK DlgProcSummary(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam){  LPSTR szMessage = NULL;  LPNMHDR notifyMessage;  char szAddtlComps[MAX_BUF];  char szTemp[MAX_BUF];  char szFormat[MAX_BUF_TINY];  BOOL hasAddtlComps = FALSE;  BOOL skipNext = FALSE;  siC *currComponent, *mainComponent;  HICON largeIcon, smallIcon;  DWORD result;  HKEY theKey;  switch(msg) {  case WM_INITDIALOG:    SetDlgItemText(hDlg, IDC_MESSAGE1, diStartInstall.szMessage0);    SetDlgItemText(hDlg, IDC_MESSAGE2, sgInstallGui.szProxyMessage);    SetDlgItemText(hDlg, IDC_CONNECTION_SETTINGS, sgInstallGui.szProxyButton);    SetDlgItemText(hDlg, IDC_INSTALL_FOLDER_LABEL, sgInstallGui.szInstallFolder);    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_CONNECTION_SETTINGS, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);    SendDlgItemMessage(hDlg, IDC_INSTALL_FOLDER_LABEL, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);    SendDlgItemMessage(hDlg, IDC_INSTALL_FOLDER, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);    SendDlgItemMessage(hDlg, IDC_PRIMARY_COMPONENT, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);    SendDlgItemMessage(hDlg, IDC_OPTIONAL_COMPONENTS, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);    ExtractIconEx("setuprsc.dll", 1, &largeIcon, &smallIcon, 1);    SendMessage(GetDlgItem(hDlg, IDC_APP_ICON), STM_SETICON, (LPARAM)smallIcon, 0);    break;    case WM_NOTIFY:    notifyMessage = (LPNMHDR)lParam;    switch (notifyMessage->code) {    case PSN_SETACTIVE:      // Wizard dialog title      PropSheet_SetTitle(GetParent(hDlg), 0, (LPTSTR)diSelectComponents.szTitle);       // Set the user-determined fields here in case they go back and change      // options - WM_INITDIALOG only gets called once, not every time the      // panel is displayed.#ifdef STUB_INSTALLER      // Update strings that relate to whether or not files will be downloaded.       // The user may have selected additional components that require a download.      if ((diAdvancedSettings.bShowDialog == FALSE) || (GetTotalArchivesToDownload() == 0)) {#endif        SetDlgItemText(hDlg, IDC_MESSAGE0, diStartInstall.szMessageInstall);        // Hide Download-related UI:        ShowWindow(GetDlgItem(hDlg, IDC_MESSAGE2), SW_HIDE);        ShowWindow(GetDlgItem(hDlg, IDC_CONNECTION_SETTINGS), SW_HIDE);#ifdef STUB_INSTALLER      }      else        SetDlgItemText(hDlg, IDC_MESSAGE0, diStartInstall.szMessageDownload);#endif      // Update the registry keys that the installer scripts use to determine      // what shortcuts to create      result = RegOpenKeyEx(HKEY_CURRENT_USER, diWindowsIntegration.szRegistryKey, 0, KEY_READ | KEY_WRITE, &theKey);      if (result == ERROR_FILE_NOT_FOUND)        result = RegCreateKey(HKEY_CURRENT_USER, diWindowsIntegration.szRegistryKey, &theKey);      if (result == ERROR_SUCCESS) {        RegSetValueEx(theKey, "Create Desktop Shortcut", 0, REG_DWORD,                       (LPBYTE)&(diWindowsIntegration.wiCB0.bCheckBoxState),                       sizeof(DWORD));        RegSetValueEx(theKey, "Create Start Menu Shortcut", 0, REG_DWORD,                       (LPBYTE)&(diWindowsIntegration.wiCB1.bCheckBoxState),                       sizeof(DWORD));        RegSetValueEx(theKey, "Create Quick Launch Shortcut", 0, REG_DWORD,                       (LPBYTE)&(diWindowsIntegration.wiCB2.bCheckBoxState),                       sizeof(DWORD));      }      // Show the components we're going to install      szAddtlComps[0] = '\0';      currComponent = siComponents;      do {        if (!currComponent)          break;        if (currComponent->dwAttributes & SIC_MAIN_COMPONENT)          mainComponent = currComponent;        else if (IsSelectableComponent(currComponent) &&                  IsComponentSelected(currComponent)) {          wsprintf(szFormat, "%s\r\n", sgInstallGui.szAddtlCompWrapper);          wsprintf(szTemp, szFormat, currComponent->szDescriptionShort);          lstrcat(szAddtlComps, szTemp);          hasAddtlComps = TRUE;        }        currComponent = currComponent->Next;      }      while (currComponent && currComponent != siComponents);      // Update the display to reflect whether or not additional components are going to       // be installed. If none are, we shift the install folder detail up so that it's      // neatly under the Primary Component name.       if (hasAddtlComps) {        wsprintf(szTemp, sgInstallGui.szPrimCompOthers, mainComponent->szDescriptionShort);        ShowWindow(GetDlgItem(hDlg, IDC_OPTIONAL_COMPONENTS), SW_SHOW);        SetDlgItemText(hDlg, IDC_OPTIONAL_COMPONENTS, szAddtlComps);        PositionControl(hDlg, IDC_OPTIONAL_COMPONENTS, IDC_INSTALL_FOLDER_LABEL, 10);      }      else {        wsprintf(szTemp, sgInstallGui.szPrimCompNoOthers, mainComponent->szDescriptionShort);        ShowWindow(GetDlgItem(hDlg, IDC_OPTIONAL_COMPONENTS), SW_HIDE);        // Shift the "Install Folder" text up in the "No Components" case        PositionControl(hDlg, IDC_PRIMARY_COMPONENT, IDC_INSTALL_FOLDER_LABEL, 10);      }      PositionControl(hDlg, IDC_INSTALL_FOLDER_LABEL, IDC_INSTALL_FOLDER, 10);      PositionControl(hDlg, IDC_INSTALL_FOLDER_LABEL, IDC_FOLDER_ICON, 7);      SetDlgItemText(hDlg, IDC_PRIMARY_COMPONENT, szTemp);      // Update the install folder.       InitPathDisplay(hDlg, sgProduct.szPath, IDC_FOLDER_ICON, IDC_INSTALL_FOLDER);            PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_NEXT|PSWIZB_BACK);      break;          case PSN_WIZNEXT:      SaveUserChanges();      if (!IsDownloadRequired()) {        // No download required, bypass the download step and go directly to         // the installing stage.         SetWindowLong(hDlg, DWL_MSGRESULT, DLG_EXTRACTING);        skipNext = TRUE;      }      break;    case PSN_WIZBACK:      // If the user selected Easy Install, go right back to the setup type      // selection page, bypassing the advanced configuration steps.       if (dwSetupType == ST_RADIO0) {        // If we showed the "Upgrade" panel, be sure to show it again in the sequence         // on the way back, to not do so "feels" wrong/confusing.         if (gDidShowUpgradePanel)           SetWindowLong(hDlg, DWL_MSGRESULT, DLG_UPGRADE);        else            SetWindowLong(hDlg, DWL_MSGRESULT, DLG_SETUP_TYPE);        skipNext = TRUE;      }      break;    case PSN_QUERYCANCEL:      return !ShouldExitSetup(hDlg);    }    break;  case WM_COMMAND:    switch(LOWORD(wParam)) {    case IDC_CONNECTION_SETTINGS:      break;    }    break;  }  return skipNext;}