CRegKey 封装操作注册表的类

时间:2014-01-27 07:21:19
【文件属性】:
文件名称:CRegKey 封装操作注册表的类
文件大小:2KB
文件格式:RAR
更新时间:2014-01-27 07:21:19
CRegKey 封装操作注册表的类 CRegKey 封装操作注册表的类 典型的使用方法举例: //添加和删除程序自启动方法 void RegAddTest() { TCHAR m_fileName[MAX_PATH]; GetModuleFileName(NULL,m_fileName,MAX_PATH); CRegKey hKey; TCHAR str[] = _T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"); hKey.SetKeyValue(HKEY_LOCAL_MACHINE, str, TEXT("测试"), m_fileName); } void RegQueryTest() { TCHAR szValue[MAX_PATH]; DWORD dwCount = MAX_PATH; CRegKey hKey; TCHAR str[] = _T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"); hKey.Open(HKEY_LOCAL_MACHINE, str); if(!hKey.QueryValue(TEXT("测试"), szValue, &dwCount)) cout< 立即下载

【文件预览】:
cregkey.h
cregkey.cpp

网友评论

  • 这个挺好用的,不足的是还是没有分别对 二进制 Dword 和SZ类型分别封装方法