本文整理汇总了C++中CKnownFile::UpdateAutoUpPriority方法的典型用法代码示例。如果您正苦于以下问题:C++ CKnownFile::UpdateAutoUpPriority方法的具体用法?C++ CKnownFile::UpdateAutoUpPriority怎么用?C++ CKnownFile::UpdateAutoUpPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKnownFile
的用法示例。
在下文中一共展示了CKnownFile::UpdateAutoUpPriority方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCommand
//.........这里部分代码省略.........
// Delete
if (!thePrefs.GetRemoveToBin()){
delsucc = DeleteFile(myfile->GetFilePath());
}
else{
// delete to recycle bin :(
TCHAR todel[MAX_PATH+1];
memset(todel, 0, sizeof todel);
_tcsncpy(todel, myfile->GetFilePath(), ARRSIZE(todel)-2);
SHFILEOPSTRUCT fp = {0};
fp.wFunc = FO_DELETE;
fp.hwnd = theApp.emuledlg->m_hWnd;
fp.pFrom = todel;
fp.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_SILENT;// | FOF_NOERRORUI
delsucc = (SHFileOperation(&fp) == 0);
}
}
if (delsucc){
theApp.sharedfiles->RemoveFile(myfile);
bRemovedItems = true;
if (myfile->IsKindOf(RUNTIME_CLASS(CPartFile)))
theApp.emuledlg->transferwnd->downloadlistctrl.ClearCompleted(static_cast<CPartFile*>(myfile));
}
else{
CString strError;
strError.Format( GetResString(IDS_ERR_DELFILE) + _T("\r\n\r\n%s"), myfile->GetFilePath(), GetErrorMessage(GetLastError()));
AfxMessageBox(strError);
}
}
m_pSharedFilesCtrl->SetRedraw(TRUE);
if (bRemovedItems)
m_pSharedFilesCtrl->AutoSelectItem();
break;
}
case MP_CMT:
ShowFileDialog(selectedList, IDD_COMMENT);
break;
case MPG_ALTENTER:
case MP_DETAIL:
ShowFileDialog(selectedList);
break;
case MP_SHOWED2KLINK:
ShowFileDialog(selectedList, IDD_ED2KLINK);
break;
case MP_PRIOVERYLOW:
case MP_PRIOLOW:
case MP_PRIONORMAL:
case MP_PRIOHIGH:
case MP_PRIOVERYHIGH:
case MP_PRIOAUTO:
{
POSITION pos = selectedList.GetHeadPosition();
while (pos != NULL)
{
CKnownFile* file = selectedList.GetNext(pos);
switch (wParam) {
case MP_PRIOVERYLOW:
file->SetAutoUpPriority(false);
file->SetUpPriority(PR_VERYLOW);
m_pSharedFilesCtrl->UpdateFile(file);
break;
case MP_PRIOLOW:
file->SetAutoUpPriority(false);
file->SetUpPriority(PR_LOW);
m_pSharedFilesCtrl->UpdateFile(file);
break;
case MP_PRIONORMAL:
file->SetAutoUpPriority(false);
file->SetUpPriority(PR_NORMAL);
m_pSharedFilesCtrl->UpdateFile(file);
break;
case MP_PRIOHIGH:
file->SetAutoUpPriority(false);
file->SetUpPriority(PR_HIGH);
m_pSharedFilesCtrl->UpdateFile(file);
break;
case MP_PRIOVERYHIGH:
file->SetAutoUpPriority(false);
file->SetUpPriority(PR_VERYHIGH);
m_pSharedFilesCtrl->UpdateFile(file);
break;
case MP_PRIOAUTO:
file->SetAutoUpPriority(true);
file->UpdateAutoUpPriority();
m_pSharedFilesCtrl->UpdateFile(file);
break;
}
}
break;
}
default:
if (wParam>=MP_WEBURL && wParam<=MP_WEBURL+256){
theWebServices.RunURL(file, wParam);
}
break;
}
}
return TRUE;
}