lstrcat(szBuf, " - ");
lstrcat(szBuf, "   ");
LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam){  BOOL                bReturn = FALSE;  siC                 *siCTemp;  DWORD               dwIndex;  DWORD               dwItems = MAX_BUF;  HWND                hwndLBComponents;  RECT                rDlg;  TCHAR               tchBuffer[MAX_BUF];  TEXTMETRIC          tm;  DWORD               y;  LPDRAWITEMSTRUCT    lpdis;  ULONGLONG           ullDSBuf;  char                szBuf[MAX_BUF];  hwndLBComponents  = GetDlgItem(hDlg, IDC_LIST_COMPONENTS);  switch(msg)  {    case WM_INITDIALOG:      DisableSystemMenuItems(hDlg, FALSE);      SetWindowText(hDlg, diSelectComponents.szTitle);      SetDlgItemText(hDlg, IDC_MESSAGE0, diSelectComponents.szMessage0);      siCTemp = siComponents;      if(siCTemp != NULL)      {        if((!(siCTemp->dwAttributes & SIC_INVISIBLE)) && (!(siCTemp->dwAttributes & SIC_ADDITIONAL)))          lbAddItem(hwndLBComponents, siCTemp);        siCTemp = siCTemp->Next;        while((siCTemp != siComponents) && (siCTemp != NULL))        {          if((!(siCTemp->dwAttributes & SIC_INVISIBLE)) && (!(siCTemp->dwAttributes & SIC_ADDITIONAL)))            lbAddItem(hwndLBComponents, siCTemp);          siCTemp = siCTemp->Next;        }        SetFocus(hwndLBComponents);        SendMessage(hwndLBComponents, LB_SETCURSEL, 0, 0);        SetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(0, FALSE, AC_COMPONENTS));      }      if(GetClientRect(hDlg, &rDlg))        SetWindowPos(hDlg,                     HWND_TOP,                     (gSystemInfo.dwScreenX/2)-(rDlg.right/2),                     (gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),                     0,                     0,                     SWP_NOSIZE);      /* update the disk space available info in the dialog.  GetDiskSpaceAvailable()         returns value in kbytes */      ullDSBuf = GetDiskSpaceAvailable(sgProduct.szPath);      _ui64toa(ullDSBuf, tchBuffer, 10);      ParsePath(sgProduct.szPath, szBuf, sizeof(szBuf), FALSE, PP_ROOT_ONLY);      RemoveBackSlash(szBuf);      lstrcat(szBuf, " - ");      lstrcat(szBuf, tchBuffer);      lstrcat(szBuf, " KB");      SetDlgItemText(hDlg, IDC_SPACE_AVAILABLE, szBuf);      SetDlgItemText(hDlg, IDC_STATIC1, sgInstallGui.szComponents_);      SetDlgItemText(hDlg, IDC_STATIC2, sgInstallGui.szDescription);      SetDlgItemText(hDlg, IDC_STATIC3, sgInstallGui.szTotalDownloadSize);      SetDlgItemText(hDlg, IDC_STATIC4, sgInstallGui.szSpaceAvailable);      SetDlgItemText(hDlg, IDWIZBACK, sgInstallGui.szBack_);      SetDlgItemText(hDlg, IDWIZNEXT, sgInstallGui.szNext_);      SetDlgItemText(hDlg, IDCANCEL, sgInstallGui.szCancel_);      SendDlgItemMessage (hDlg, IDC_STATIC1, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC2, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC3, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC4, 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_LIST_COMPONENTS, WM_SETFONT, (WPARAM)sgInstallGui.systemFont, 0L);      SendDlgItemMessage (hDlg, IDC_STATIC_DESCRIPTION, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_DOWNLOAD_SIZE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      SendDlgItemMessage (hDlg, IDC_SPACE_AVAILABLE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);      gdwACFlag = AC_COMPONENTS;      OldListBoxWndProc = SubclassWindow(hwndLBComponents, (WNDPROC)NewListBoxWndProc);      break;    case WM_DRAWITEM:      lpdis = (LPDRAWITEMSTRUCT)lParam;      // If there are no list box items, skip this message.      if(lpdis->itemID == -1)        break;      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, AC_COMPONENTS);      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(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);      }            DrawCheck(lpdis, AC_COMPONENTS);      // draw the focus rect on the selected item      if((lpdis->itemAction & ODA_FOCUS) &&         (lpdis->itemState & ODS_FOCUS))      {        DrawFocusRect(lpdis->hDC, &(lpdis->rcItem));      }      bReturn = TRUE;      /* update the disk space required info in the dialog.  It is already         in Kilobytes */      ullDSBuf = GetDiskSpaceRequired(DSR_DOWNLOAD_SIZE);      _ui64toa(ullDSBuf, tchBuffer, 10);      lstrcpy(szBuf, tchBuffer);      lstrcat(szBuf, " KB");            SetDlgItemText(hDlg, IDC_DOWNLOAD_SIZE, szBuf);      break;    case WM_COMMAND:      switch(LOWORD(wParam))      {        case IDC_LIST_COMPONENTS:          /* to update the long description for each component the user selected */          if((dwIndex = SendMessage(hwndLBComponents, LB_GETCURSEL, 0, 0)) != LB_ERR)            SetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(dwIndex, FALSE, AC_COMPONENTS));          break;        case IDWIZNEXT:          DestroyWindow(hDlg);          DlgSequenceNext();          break;        case IDWIZBACK:          DestroyWindow(hDlg);          DlgSequencePrev();          break;        case IDCANCEL:          AskCancelDlg(hDlg);          break;        default:          break;      }      break;  }  return(bReturn);}