封裝了乙個簡單的登錄檔操作類

2021-04-01 11:23:30 字數 1120 閱讀 8205

#if !defined(afx_registry_h__e0610a5d_7166_4d02_9d7e_11af7cf8e229__included_)

#define afx_registry_h__e0610a5d_7166_4d02_9d7e_11af7cf8e229__included_

//建立新鍵的返回值

#include

const uint nreturnnewkeysuccess=1;

const uint nreturnnewkeyfail=0;

class regto*******

");//主鍵

//uint openkey(cstring );

uint newakey();//新字鍵的名稱

uint addstrtokey(lpctstr,lpctstr);//第乙個是要新增新新項的名稱,第二個是數值

void closehkey();//關閉主鍵

~regto*******();

private:

//主鍵

hkey m_hkey;

//要新建的目錄

cstring m_sziekey;

//要新建鍵

cstring m_sznewkey;

//要開啟的目錄

cstring m_szopenitem;

};#endif//afx_registry_h__e0610a5d_7166_4d02_9d7e_11af7cf8e229__included_

#include "stdafx.h"

#include "regto*******.h"

regto*******::regto*******(hkey hkey,cstring sziekey,cstring sznewkey)

uint regto*******::newakey()

return nreturnnewkeyfail;

}uint regto*******::addstrtokey(lpctstr sznewitem,lpctstr sznewvalue)

void regto*******::closehkey()

}regto*******::~regto*******()

乙個操作登錄檔的類

windows 作業系統的登錄檔包含了很多有關計算機執行的配置方式,開啟登錄檔我們可以看到登錄檔是按類似於目錄的樹結構組織的,其中第二級目錄包含了五個預定義主鍵分別是 hkey classes root,hkey current user,hkey local machine,hkey users,...

乙個操作登錄檔的類

namespace power ponent region 公共方法 寫入登錄檔,如果指定項已經存在,則修改指定項的值 登錄檔基項列舉 登錄檔項,不包括基項 值名稱 值 返回布林值,指定操作是否成功 public bool setvalue power ponent.register.keytype...

用C 封裝了乙個簡單的「按鈕」類

功能簡單,僅僅實現按鈕的按下和鬆開的效果,按鈕具體實現什麼功能就由開發者自己定義了 1 include 2 include 3 include 4using namespace std 5class botton 25void lbotton down 滑鼠左鍵按下 26 35void lontto...