VC中实现历史记录的全面清除
2009-10-15 20:31:28 来源:WEB开发网6、清收藏夹中的内容
TCHAR szPath[MAX_PATH];
if (SHGetSpecialFolderPath(NULL, szPath, CSIDL_FAVORITES, FALSE))
{ //得到目录,并清空
EmptyDirectory(szPath);
}
7、清RAS自动拨号历史记录
SHDeleteKey(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\RAS Autodial\\Addresses"));
8、清系统临时文件夹
TCHAR szPath[MAX_PATH];
if (GetTempPath(MAX_PATH, szPath))//得到系统临时目录
{
EmptyDirectory(szPath, TRUE);
}
9、清空回收站
SHEmptyRecycleBin(NULL, NULL,
SHERB_NOCONFIRMATION | SHERB_NOPROGRESSUI | SHERB_NOSOUND);
10、清除"运行"中的自动匹配历史记录
SHDeleteKey(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU"));
11、清"文档"中的历史记录
TCHAR szPath[MAX_PATH];
if (SHGetSpecialFolderPath(NULL, szPath, CSIDL_RECENT, FALSE))
{
EmptyDirectory(szPath);
}
SHDeleteKey(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RecentDocs"));
12、清除上次登陆用户记录
SHDeleteValue(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"),
_T("DefaultUserName"));
SHDeleteValue(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"),
_T("AltDefaultUserName"));
SHDeleteValue(HKEY_LOCAL_MACHINE,
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Winlogon"),
_T("DefaultUserName"));
13、清除"查找文件"自动匹配历史记录
SHDeleteKey(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Doc Find Spec
MRU"));
SHDeleteKey(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Internet Explorer\\Explorer Bars\\{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}\\ContainingTextMRU"));
SHDeleteKey(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Internet Explorer\\Explorer Bars\\{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}\\FilesNamedMRU"));
14、清除"查找计算机"自动匹配历史记录
SHDeleteKey(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FindComputerMRU"));
SHDeleteKey(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Internet Explorer\\Explorer Bars\\{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}\\ComputerNameMRU"));
更多精彩
赞助商链接