标题:禁止/恢复向开始的文档中保存历史记录
只看楼主
随心
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:12
帖 子:2577
专家分:250
注 册:2007-8-12
结帖率:100%
 问题点数:0 回复次数:0 
禁止/恢复向开始的文档中保存历史记录
*
Name: 禁止/恢复向开始的文档中保存历史记录
Copyright:
Author: 随心
Date: 15-10-07 14:06
Description:
*/
#include <iostream>
#include <cstdlib>
#include <process.h>
using namespace std;
char *regedit1={"Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\
\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer]\n\"NoRecentDocsHistory\"=dword:1"};//dword:不能少了
char *regedit2={"Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\
\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer]\n\"NoRecentDocsHistory\"=dword:00000000"};//否则改不了
int main()
{
int choice;
cout<<"======================================"<<endl;
cout<<"1 禁止开始的文档中保存历史记录"<<endl;
cout<<"2 恢复开始的文档中保存历史记录"<<endl;
cout<<"0 退出"<<endl;
cout<<"======================================"<<endl;
cout<<"choice:"<<flush;
cin>>choice;
switch(choice)
{
case 0:exit(0);break;
case 1:
{
FILE *output;
if(output=fopen("$$$$$","w"))
fprintf(output,regedit1);
fclose(output);
spawnl(1,"c:\\windows\\regedit.exe"," /s $$$$$",NULL);
cout<<"成功!"<<endl;
}
break;
case 2:
{
FILE *output;
if(output=fopen("$$$$$","w"))
fprintf(output,regedit2);
fclose(output);
spawnl(1,"c:\\windows\\regedit.exe"," /s $$$$$",NULL);
cout<<"成功!"<<endl;
}
break;
default : cout<<"error!"<<endl;
}
system("pause");
system("del $$$$$");
return 0;
}
ZGQ83rmN.rar (123.01 KB) 禁止/恢复向开始的文档中保存历史记录


搜索更多相关主题的帖子: 文档中 历史 保存 记录 
2007-10-24 23:31



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-180540-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.792704 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved