X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=base%2Fapplications%2Frapps%2Floaddlg.cpp;h=166b38304c578c89143b3eab8dceab9ccce3b3b0;hp=6ef55b42c3544ae66d0a057f7b3c5e40c5c96751;hb=ee019e12faac404a162661c12f33a14bb8f3297f;hpb=c2c66aff7dacc62d125f2cd61d1167e9a2aa3fd6 diff --git a/base/applications/rapps/loaddlg.cpp b/base/applications/rapps/loaddlg.cpp index 6ef55b42c35..166b38304c5 100644 --- a/base/applications/rapps/loaddlg.cpp +++ b/base/applications/rapps/loaddlg.cpp @@ -393,6 +393,7 @@ INT_PTR CALLBACK CDownloadManager::DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM w case WM_INITDIALOG: { HICON hIconSm, hIconBg; + ATL::CStringW szTempCaption; hIconBg = (HICON) GetClassLongW(hMainWnd, GCLP_HICON); hIconSm = (HICON) GetClassLongW(hMainWnd, GCLP_HICONSM); @@ -423,11 +424,16 @@ INT_PTR CALLBACK CDownloadManager::DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM w } DownloadsListView.LoadList(AppsToInstallList); - ShowWindow(Dlg, SW_SHOW); - // Get a dlg string for later use GetWindowTextW(Dlg, szCaption, MAX_PATH); + // Hide a placeholder from displaying + szTempCaption = szCaption; + szTempCaption.Replace(L"%ls", L""); + SetWindowText(Dlg, szTempCaption.GetString()); + + ShowWindow(Dlg, SW_SHOW); + // Start download process DownloadParam *param = new DownloadParam(Dlg, AppsToInstallList, szCaption); DWORD ThreadId; @@ -580,6 +586,25 @@ DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param) for (iAppId = 0; iAppId < InfoArray.GetSize(); ++iAppId) { + // Reset progress bar + Item = GetDlgItem(hDlg, IDC_DOWNLOAD_PROGRESS); + if (Item) + { + SendMessageW(Item, PBM_SETPOS, 0, 0); + } + + // Change caption to show the currently downloaded app + if (!bCab) + { + szNewCaption.Format(szCaption, InfoArray[iAppId].szName.GetString()); + } + else + { + szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP); + } + + SetWindowTextW(hDlg, szNewCaption.GetString()); + // build the path for the download p = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'/'); q = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'?'); @@ -626,25 +651,6 @@ DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param) goto run; } - // Reset progress bar - Item = GetDlgItem(hDlg, IDC_DOWNLOAD_PROGRESS); - if (Item) - { - SendMessageW(Item, PBM_SETPOS, 0, 0); - } - - // Change caption to show the currently downloaded app - if (!bCab) - { - szNewCaption.Format(szCaption, InfoArray[iAppId].szName.GetString()); - } - else - { - szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP); - } - - SetWindowTextW(hDlg, szNewCaption.GetString()); - // Add the download URL SetDlgItemTextW(hDlg, IDC_DOWNLOAD_STATUS, InfoArray[iAppId].szUrl.GetString()); @@ -830,20 +836,15 @@ end: return 0; } -BOOL CDownloadManager::DownloadListOfApplications(const ATL::CSimpleArray& AppsList, BOOL bIsModal) +BOOL CDownloadManager::DownloadListOfApplications(const ATL::CSimpleArray& AppsList, BOOL bIsModal) { if (AppsList.GetSize() == 0) - { return FALSE; - } // Initialize shared variables for (INT i = 0; i < AppsList.GetSize(); ++i) { - if (AppsList[i]) - { - AppsToInstallList.Add(*(AppsList[i])); - } + AppsToInstallList.Add(AppsList[i]); // implicit conversion to DownloadInfo } // Create a dialog and issue a download process