china.com
主页
新闻
体育
游戏
文化
教育
健康
财经
科技
旅游
军事
娱乐
商贸
  科技动态 硬件广场 下载基地 网络教室 网络冲浪 科学博览 移动时代 手机上网 桌面壁纸 科技商情  


C++builder编程修改注册表的问题

2000-08-16 14:11:52

RootKey是注册表的根键值,比如运行regedit后看到的HKEY_USERS,HKEY_LOCAL_MACHINE就是RootKey,在TRegIniFile中缺省的RootKey
是HKEY_USERS.

下面的例子是TRegistry的,TRegIniFile也差不多

void __fastcall TfrmMainForm::WriteToMyRegistry(int table_count)

{

  //TODO: Add your source code here

  TRegistry *MyRegistry=new TRegistry;

  MyRegistry->RootKey=HKEY_LOCAL_MACHINE;

   //改变缺省Rootkey

  if(!MyRegistry->OpenKey("Software\\Microsoft\\Windows\\Current\

                Version\\Run",true)) //打开主键

   //这样双引号里面的东西就变成了CurrentKey

   {

     Application->MessageBox("注册表内容无效",

                 "读取注册表出错",MB_ICONERROR);

     MyRegistry->CloseKey();

     delete MyRegistry;

     return;

    }

  MyRegistry->WriteString("myrun","c:\\sthvcd\\sthvcd.exe");

  MyRegistry->CloseKey();

  delete MyRegistry;

  摘自《赛迪网》 /文

404 Not Found

404 Not Found


nginx


科技检索


中华网推荐

  • 1000名医生在线咨询

  • 中国足球队官方网站

  • 鸦片玫瑰(新版)

  • 精选股票天地

  • 闪光的flash教程

  • 中华网汽车世界

  • 为你的爱情出谋划策

  • 网文精选——野百合集

  • 世界文化遗产在中国

  • 历届香港小姐风姿集



  •  


    网络教室编辑信箱
    版权声明 | 本站检索 | 联系方法 | 刊登广告 | 使用说明 | 关于中华网 | 豁免条款

    版权所有 中华网