DWORD dwStart = GetTickCount();
DWORD dwStop = GetTickCount();
while (dwStop - dwStart<10000)
{
int n = (dwStop - dwStart) / 1000;
CString msg;
msg.Format(_T("是否删除?\r\n(%d秒后才能删除)"), 10-n);
if (AfxMessageBox(msg, MB_YESNO) != IDYES)
return;
dwStop = GetTickCount();
}
10秒后才能出循环。防止误删、、、太简单了。