public IBindStatusCallback
{
HWND m_hDialog;
- PBOOL m_pbCancelled;
BOOL m_UrlHasBeenCopied;
CDownloaderProgress* m_progress;
//DestroyWindow(m_hDialog);
}
- HRESULT Initialize(HWND Dlg, BOOL *pbCancelled, CDownloaderProgress* pProgress)
+ HRESULT Initialize(HWND Dlg, CDownloaderProgress* pProgress)
{
m_hDialog = Dlg;
- m_pbCancelled = pbCancelled;
m_UrlHasBeenCopied = FALSE;
m_progress = pProgress;
return S_OK;
r = GetWindowLongPtrW(m_hDialog, GWLP_USERDATA);
if (r || GetLastError() != ERROR_SUCCESS)
{
- *m_pbCancelled = TRUE;
return E_ABORT;
}
};
extern "C"
-HRESULT WINAPI CDownloadDialog_Constructor(HWND Dlg, BOOL *pbCancelled, CDownloaderProgress* pProgress, REFIID riid, LPVOID *ppv)
+HRESULT WINAPI CDownloadDialog_Constructor(HWND Dlg, CDownloaderProgress* pProgress, REFIID riid, LPVOID *ppv)
{
- return ShellObjectCreatorInit<CDownloadDialog>(Dlg, pbCancelled, pProgress, riid, ppv);
+ return ShellObjectCreatorInit<CDownloadDialog>(Dlg, pProgress, riid, ppv);
}
#ifdef USE_CERT_PINNING
}
}
-
// Download dialog (loaddlg.cpp)
class CDownloadManager
{
static ATL::CSimpleArray<DownloadInfo> AppsToInstallList;
static CDowloadingAppsListView DownloadsListView;
static CDownloaderProgress ProgressBar;
-
+ static BOOL bCancelled;
public:
static VOID Add(DownloadInfo info);
static VOID Download(const DownloadInfo& DLInfo, BOOL bIsModal = FALSE);
ATL::CSimpleArray<DownloadInfo> CDownloadManager::AppsToInstallList;
CDowloadingAppsListView CDownloadManager::DownloadsListView;
CDownloaderProgress CDownloadManager::ProgressBar;
-
+BOOL CDownloadManager::bCancelled;
VOID CDownloadManager::Add(DownloadInfo info)
{
HICON hIconSm, hIconBg;
ATL::CStringW szTempCaption;
+ bCancelled = FALSE;
+
hIconBg = (HICON) GetClassLongPtrW(hMainWnd, GCLP_HICON);
hIconSm = (HICON) GetClassLongPtrW(hMainWnd, GCLP_HICONSM);
case WM_COMMAND:
if (wParam == IDCANCEL)
{
- SetWindowLongW(Dlg, GWLP_USERDATA, 1);
+ bCancelled = TRUE;
PostMessageW(Dlg, WM_CLOSE, 0, 0);
}
return FALSE;
ULONG dwCurrentBytesRead = 0;
ULONG dwStatusLen = sizeof(dwStatus);
- BOOL bCancelled = FALSE;
BOOL bTempfile = FALSE;
BOOL bCab = FALSE;
// download it
bTempfile = TRUE;
- CDownloadDialog_Constructor(hDlg, &bCancelled, &ProgressBar, IID_PPV_ARG(IBindStatusCallback, &dl));
+ CDownloadDialog_Constructor(hDlg, &ProgressBar, IID_PPV_ARG(IBindStatusCallback, &dl));
if (dl == NULL)
goto end;