if ((pnic->uNewState & LVIS_STATEIMAGEMASK) && !bUpdating)
{
BOOL checked = ListView_GetCheckState(pnic->hdr.hwndFrom, pnic->iItem);
- nSelectedApps += (checked) ? 1 : -1;
+ /* FIXME: HAX!
+ - preventing decremention below zero as a safeguard for ReactOS
+ In ReactOS this action is triggered whenever user changes *selection*, but should be only when *checkbox* state toggled
+ Maybe LVIS_STATEIMAGEMASK is set incorrectly
+ */
+ nSelectedApps +=
+ (checked)
+ ? 1
+ :((nSelectedApps > 0)
+ ? -1
+ : 0);
UpdateStatusBarText();
}
}
break;
case ID_INSTALL:
- if (nSelectedApps)
+ if (nSelectedApps > 0)
{
CDownloadManager::DownloadListOfApplications(m_ListView->GetCheckedItems());
UpdateApplicationsList(-1);
m_UrlHasBeenCopied = TRUE;
}
- SetLastError(0);
+ SetLastError(ERROR_SUCCESS);
r = GetWindowLongPtrW(m_hDialog, GWLP_USERDATA);
- if (0 != r || 0 != GetLastError())
+ if (r || GetLastError() != ERROR_SUCCESS)
{
*m_pbCancelled = TRUE;
return E_ABORT;
case WM_CLOSE:
EndDialog(Dlg, 0);
- DestroyWindow(Dlg);
+ //DestroyWindow(Dlg);
return TRUE;
default:
if (hOut == INVALID_HANDLE_VALUE)
goto end;
+ dwCurrentBytesRead = 0;
do
{
if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead))
}
dwCurrentBytesRead += dwBytesRead;
- dl->OnProgress(dwCurrentBytesRead, dwContentLen, 0, pCurrentInfo->szUrlDownload);
+ dl->OnProgress(dwCurrentBytesRead, dwContentLen, 0, pCurrentInfo->szUrlDownload.GetString());
} while (dwBytesRead && !bCancelled);
CloseHandle(hOut);
hMainWnd,
DownloadDlgProc);
}
-
}
// CDownloadManager