zoukankan      html  css  js  c++  java
  • 注册表编程

    // regedit.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include <Windows.h> 
    
    
    #define RRF_RT_ANY 0x0000ffff;
    int main(int argc, char* argv[])
    {    
        char *buff="Software\11gamereg";    
        LPDWORD dwSize;
        BYTE result[100]={0};
        int initVlue=33;
        HKEY hKey;
        
        /**********打开注册表*********/     
        if( RegOpenKey(HKEY_LOCAL_MACHINE,buff,&hKey)==0)
        {
            printf("open success !
    ");
        }
        else
        {
            printf("open failed!
    ");
        }
            /**********打开注册表*********/     
        if( RegSetValueEx(hKey,"FirstSetup",0,REG_DWORD,(BYTE *) &initVlue,sizeof(result)) !=ERROR_SUCCESS)
        {
            printf("set error !
    ");
        }
        else
        {
            printf("set success
    ");
        }
            /**********打开注册表*********/     
        if( RegQueryValueEx(hKey,"FirstSetup",0,NULL,(BYTE *)result,(LPDWORD)&dwSize) !=ERROR_SUCCESS)
        {
            printf("getvalue error !
    ");
        }
        else
        {
            printf("%d 
    ",result);
        }
            /**********打开注册表*********/     
        if(RegCloseKey(hKey)==0)
        {
            printf("close success!
    ");
        }
        else{
            printf("close failed!
    ");
        }
        return 0;
    }

  • 相关阅读:
    反射
    jQuery之Dom操作
    Jquery学习开篇
    c#构造函数
    c#之委托
    DataX启动步骤解析
    JobContainer
    DataX 启动配置
    DataX源码分析(2)
    DataX源码分析(1)
  • 原文地址:https://www.cnblogs.com/ymecho/p/3447316.html
Copyright © 2011-2022 走看看