In this project I will create a module into which I will gradually create useful functions for working with register keys, values in system.

I firmly believe that they will be useful and helpful to me:]]

 

AddToRegistry

The AddToRegistry (...) function adds value and its name into the registry path.


       void AddToRegistry(::std::string globalpath, ::std::string name, ::std::string value)

Parameter "globalpath" represents the keyname of registry what we want to creating value inside it.
Parameter "name" represents the parameter by name of value.
Parameter "value" represents tje value parameter of value of the name created key.

 

GetRegistry

The GetRegistry (...) function queryes value from defined globalpath (key) by name.


       bool GetRegistry(::std::string globalpath, char* stringname, ::std::string & buffer)

Parameter "globalpath" represents the keyname of registry what we want to query value from it.
Parameter "name" represents the parameter by name of value.
Parameter "value" represents the output value parameter of quered content.

 

 

DelRegistryValue

The DelRegistryValue (...) function deletes name and value from defined globalpath (key).


       void DelRegistryValue(::std::string globalpath, ::std::string value)

Parameter "globalpath" represents the keyname of registry what we want to delete value from it.
Parameter "value" represents the value parameter fotr delete.

 

 

DelRegistryNode

The DelRegistryNode (...) function deletes key node from registry.


       void DelRegistryNode(::std::string node)

Parameter "node" represents the registry node name of registry what we want to delete.

 

 

 

Examples:

 


   #include "WinApi.h" // https://www.netbot.sk/en/14-blog-headers/44-winapi-en
#include "Regedit.h"

#define __Global_Registry_Path__IsPotectRunning__ "SOFTWARE\\Classes\\._sln1.10.90"
#define __Save_Key_Name_Protect__ "SystemInfo"
#define __Is_Active__ "System-100140"

#define __Global_ExecutePath__ "SOFTWARE\\Classes\\._sln1.10.90"
#define __Save_Key_Name_Execute_Path__ "ExecPth"

int _cdecl main (void)
{
::Diall_Regedit::Regedit * RegeditA = new ::Diall_Regedit::Regedit();

//Add Value//
RegeditA->AddToRegistry(__Global_Registry_Path__IsPotectRunning__, __Save_Key_Name_Protect__, __Is_Active__);

//Query Value//
::std::string servicepathfromregistrytemp;
const char * servicepathfromregistry;

RegeditA->GetRegistry(__Global_ExecutePath__, __Save_Key_Name_Execute_Path__, servicepathfromregistrytemp);
servicepathfromregistry = servicepathfromregistrytemp.c_str();

//Delete Key Node//
RegeditA->DelRegistryNode(__Global_Registry_Path__IsPotectRunning__);
RegeditA->DelRegistryNode(__Save_Key_Name_Execute_Path__);
RegeditA->DelRegistryNode(__Global_ExecutePath__);

delete RegeditA;

return 0;
}

 

 

 

 

Regedit.h 
--------------------------------------------------------------------- 
Podporovaný jazyk: C++
Typ vývojového prostredia: Visual Studio IDE
Posledná revízia: 21.10 2020
Autor: Diallix

Download Header: 

---------------------------------------------------------------------