• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 關于C++builder編程修改注冊表的問題

    發表于:2007-05-26來源:作者:點擊數: 標簽:
    RootKey是注冊表的根鍵值,比如運行regedit后看到的HKEY_USERS,HKEY_LOCAL_MACHINE就是RootKey,在TRegIniFile中缺省的RootKey是HKEY_USERS. 下面的例子是TRegistry的,TRegIniFile也差不多 void __fastcall TfrmMainForm::WriteToMyRegistry(int table_count

    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;

    原文轉自:http://www.kjueaiud.com

    評論列表(網友評論僅供網友表達個人看法,并不表明本站同意其觀點或證實其描述)
    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>