-
3个VC++ win注册表编程操作实例
本源码中有三个VC++操作表的相关例子,每一个都属于比较简单那种,展示注册表的操作技巧,有兴趣的下载源码包。
HKEY hKEY; //定义有关的 hKEY, 在查询结束时要关闭。
LPCTSTR data_Set="SoftwareMicrosoftWindowsCurrentVersion"; //子键目标
//打开与路径 data_Set 相关的 hKEY,第一个参数为根键名称,第二个参数表。
//表示要访问的键的位置,第三个参数必须为0,KEY_READ表示以查询的方式。
//访问注册表,hKEY则保存此函数所打开的键的句柄。
long retopen=(::RegOpenKeyEx(HKEY_LOCAL_MACHINE,data_Set, 0, KEY_READ, &hKEY));
if(retopen!=ERROR_SUCCESS) //如果无法打开hKEY,则终止程序的执行
{
MessageBox("错误: 无法打开有关的hKEY!");
return;
}
//查询有关的数据 (系统用户姓名 owner_Get)。
LPBYTE owner_Get=new BYTE[80];
DWORD type_1=REG_SZ ;
DWORD cbData_1=80;
//hKEY为刚才RegOpenKeyEx()函数所打开的键的句柄,"RegisteredOwner"。
//表示要查 询的键值名,type_1表示查询数据的类型,owner_Get保存所。
//查询的数据,cbData_1表示预设置的数据长度。
//与RegQureyValueEx()类似,hKEY表示已打开的键的句柄,"RegisteredOwner"
//表示要访问的键值名,owner_Set表示新的键值,type_1和cbData_1表示新值。
//的数据类型和数据长度
UpdateData(true);//获得编辑框数据
if(m_Adduser.IsEmpty()||m_Addpassword.IsEmpty())//用户名、密码不能为空
{
AfxMessageBox("输入用户名、密码不能为空!");
return;
}
- 2022-02-22 09:55:12下载
- 积分:1
-
VC++
- 2022-03-29 19:51:53下载
- 积分:1
-
20152213Plot
VC++ MFC 实现的实时曲线功能,很好的例子,这个在网上很少能找到(VC++ MFC to achieve real-time curve drawing, a good example, this rarely found online)
- 2015-01-15 08:37:36下载
- 积分:1
-
C_language_funny_programming
C语言趣味程序百例精解,面试中你可能会遇到的题目哦(C language program 100 cases of sperm solution interesting interviews you may encounter the subject of Oh)
- 2008-04-23 19:45:44下载
- 积分:1
-
点过咯这
说明: dian guo lo zhe,cao,hello word
- 2019-05-09 20:25:10下载
- 积分:1
-
MFCMapInfoVC++
介绍了 Mapinfo 提供的与其他程序连接 ,进行二次开发的方法,以及Mapinfo 数字地图在 VC++中的具体实现过程。(Mapinfo provided the introduction and other procedures connected to the secondary development of methodology and Mapinfo Digital Map in VC++ Realize specific process.)
- 2008-05-01 14:01:55下载
- 积分:1
-
CodeManage
说明: 个人代码库,VC6+ACCESS。增删改查,最小化托盘等。(Personal code library, VC6+ ACCESS. Additions and deletions to the investigation, the smallest of the tray.)
- 2011-02-28 16:47:08下载
- 积分:1
-
南开一百题答案
这个是南开大学上机100题的题目和答案,对学习c语言的人有很大的帮助(Nankai University is the 100 on the plane and that the questions and answers, to learn the language c there is a great help)
- 2020-06-26 09:40:02下载
- 积分:1
-
sleeplight
program that simulates apple computers sleeplight!
- 2011-02-28 06:41:48下载
- 积分:1
-
100个经典C语言程序资料
说明: 本资料针对有一定基础的C语言学习爱好者,使用100个经典面试题出发,对C语言的应用做了经典的诠释,可以使用本资料对常见的100个面试题和应用实际进行学习,提高自己应用C语言的能力而不是仅仅停留在基础知识,这些在考试题中也经常遇到。(This material aims at the C language learning enthusiasts who have a certain foundation. Starting from 100 classic interview questions, it makes a classic interpretation of the application of C language. You can use this material to learn the common 100 interview questions and application practice, improve your ability to apply C language rather than just stay in the basic knowledge, which is also often encountered in the examination questions.)
- 2020-04-28 12:08:27下载
- 积分:1