VC操作登錄檔

2021-05-21 21:37:15 字數 1038 閱讀 2234

vc操作登錄檔

邵盛松 2010-3-2

新增標頭檔案atlbase.h

寫入登錄檔鍵值

以設定字串值為例

cstring strpath=_t("c://name.exe")

cregkey key;

if(key.create(hkey_local_machine,_t("software//microsoft//windows//currentversion//run"))==error_success)

key.close();

刪除登錄檔鍵值

cregkey key;

if (key.open(hkey_local_machine,_t("software//microsoft//windows//currentversion//run"))==error_success)

key.close();

}列舉子鍵

cstdiofile stdfile;

stdfile.open(_t("c://test.txt"),cfile::modecreate|cfile::modenotruncate|cfile::modereadwrite);

cstring strtemp;

cregkey reg;

if (reg.open(hkey_local_machine, _t("software//microsoft//windows//currentversion//uninstall")) != error_success)

return;

dword dwindex = 0;

dword len =_max_path;

tchar szsubkeyname[_max_path];

long lret;

while ((lret = reg.enumkey(dwindex, szsubkeyname, &len)) != error_no_more_items)

dwindex++;

len = _max_path;

}stdfile.close();

VC操作登錄檔

1.vc讀取登錄檔資訊 hkey hkey lpctstr data set software yeete s long ret5 regopenkeyex hkey local machine,data set,0,key write key read,hkey long ret0 regdele...

VC 登錄檔操作

獲取登錄檔值 hkey hkey lpctstr data set software internet long ret0 regopenkeyex hkey local machine,data set,0,key all access,hkey lpbyte lpa new byte 500 d...

VC操作登錄檔

日誌原文 編寫軟體登錄檔的讀寫是基本的操作,這裡直接將源 貼出來,大家共享並擴充套件,希望大家還可以回來,將您的 貼出來,共同進步,這裡對的幫助表示感謝。regop.cpp implementation of the regop class.註冊軟體 include stdafx.h include...