SendDlgItemMessage (hDlg, DLG_BROWSE_DIR, WM_SETFONT, (WPARAM)myGetSysFont(), 0L); SendDlgItemMessage (hDlg, 1092, WM_SETFONT, (WPARAM)myGetSysFont(), 0L); SendDlgItemMessage (hDlg, 1091, WM_SETFONT, (WPARAM)myGetSysFont(), 0L); SendDlgItemMessage (hDlg, 1, WM_SETFONT, (WPARAM)myGetSysFont(), 0L); SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)myGetSysFont(), 0L); SendDlgItemMessage (hDlg, IDC_EDIT_DESTINATION, WM_SETFONT, (WPARAM)myGetSysFont(), 0L); SendDlgItemMessage (hDlg, 1121, WM_SETFONT, (WPARAM)myGetSysFont(), 0L); SendDlgItemMessage (hDlg, 1137, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);
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);
LRESULT CALLBACK BrowseHookProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){  DWORD dwIndex;  DWORD dwLoop;  RECT  rDlg;  char  szBuf[MAX_BUF];  char  szBufIndex[MAX_BUF];  char  szPath[MAX_BUF];  HWND  hwndLBFolders;  switch(message)  {    case WM_INITDIALOG:      hwndLBFolders  = GetDlgItem(hDlg, 1121);      SetDlgItemText(hDlg, IDC_EDIT_DESTINATION, szTempSetupPath);      if(GetClientRect(hDlg, &rDlg))        SetWindowPos(hDlg,                     HWND_TOP,                     (gSystemInfo.dwScreenX/2)-(rDlg.right/2),                     (gSystemInfo.dwScreenY/2)-(rDlg.bottom/2),                     0,                     0,                     SWP_NOSIZE);      OldListBoxWndProc    = 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)myGetSysFont(), 0L);       SendDlgItemMessage (hDlg, 1092, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);       SendDlgItemMessage (hDlg, 1091, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);       SendDlgItemMessage (hDlg, 1, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);       SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);       SendDlgItemMessage (hDlg, IDC_EDIT_DESTINATION, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);       SendDlgItemMessage (hDlg, 1121, WM_SETFONT, (WPARAM)myGetSysFont(), 0L);       SendDlgItemMessage (hDlg, 1137, WM_SETFONT, (WPARAM)myGetSysFont(), 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:          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));          if(FileExists(szBuf) == FALSE)          {            char szMsgCreateDirectory[MAX_BUF];            char szStrCreateDirectory[MAX_BUF];            char szBufTemp[MAX_BUF];            char szBufTemp2[MAX_BUF];            GetPrivateProfileString("Messages", "STR_CREATE_DIRECTORY", "", szStrCreateDirectory, sizeof(szStrCreateDirectory), szFileIniInstall);            if(GetPrivateProfileString("Messages", "MSG_CREATE_DIRECTORY", "", szMsgCreateDirectory, sizeof(szMsgCreateDirectory), szFileIniInstall))            {              lstrcpy(szBufTemp, "\n\n");              lstrcat(szBufTemp, szBuf);              RemoveBackSlash(szBufTemp);              lstrcat(szBufTemp, "\n\n");              wsprintf(szBufTemp2, szMsgCreateDirectory, szBufTemp);            }            if(MessageBox(hDlg, szBufTemp2, szStrCreateDirectory, MB_YESNO | MB_ICONQUESTION) == IDYES)            {              char szBuf2[MAX_PATH];              if(CreateDirectoriesAll(szBuf, TRUE) == FALSE)              {                char szECreateDirectory[MAX_BUF];                lstrcpy(szBufTemp, "\n\n");                lstrcat(szBufTemp, sgProduct.szPath);                RemoveBackSlash(szBufTemp);                lstrcat(szBufTemp, "\n\n");                if(GetPrivateProfileString("Messages", "ERROR_CREATE_DIRECTORY", "", szECreateDirectory, sizeof(szECreateDirectory), szFileIniInstall))                  wsprintf(szBuf, szECreateDirectory, szBufTemp);                MessageBox(hDlg, szBuf, "", MB_OK | MB_ICONERROR);                break;              }              if(*sgProduct.szSubPath != '\0')              {                 /* log the subpath for uninstallation.  This subpath does not normally get logged                  * for uninstallation due to a chicken and egg problem with creating the log file                  * and the directory its in */                lstrcpy(szBuf2, szBuf);                AppendBackSlash(szBuf2, sizeof(szBuf2));                lstrcat(szBuf2, sgProduct.szSubPath);                UpdateInstallLog(KEY_CREATE_FOLDER, szBuf2, FALSE);              }              bCreateDestinationDir = TRUE;            }            else            {              break;            }          }          lstrcpy(szTempSetupPath, szBuf);          RemoveBackSlash(szTempSetupPath);          EndDialog(hDlg, 0);          break;      }      break;  }  return(0);}