Registry Functions

All code Create, get, set… Registry.

prototype CreateRegistryKey(STRING, STRING, NUMBER, STRING, NUMBER,BOOL);
prototype STRING GetRegistryValue(STRING, STRING, NUMBER,NUMBER);
prototype STRING GetRegistryValue2(STRING,STRING);

//--------------------------------------------------------------------------
function CreateRegistryKey(szKey, szNumName, nType, szNumValue, nSize,blnWillBeDeleteWhenUninstall) 
STRING szMsg;
begin       
	
	RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
	if blnWillBeDeleteWhenUninstall=FALSE then
		Disable(LOGGING);                        
	endif;   
	if (RegDBCreateKeyEx (szKey, "") < 0) then
 	      //  MessageBox ("RegDBCreateKeyEx failed.", SEVERE);
   else
		   if (RegDBSetKeyValueEx (szKey, szNumName, nType, szNumValue, nSize) < 0) then
		
		  //     MessageBox ("RegDBSetKeyValueEx failed.", SEVERE);
		      	
		   else
		
		    //  szMsg = "%s set to: %s";
		    //  SprintfBox (INFORMATION, "fadfS", szMsg, szNumName, szNumValue);
		
		  endif;
    endif;    
    if blnWillBeDeleteWhenUninstall=FALSE then
    	Enable(LOGGING);
    endif;
    
    
end;
function STRING GetRegistryValue(szKey,szNumName,nvType,nvSize)
	STRING RESULT,svNumValue;
	
begin            
    
    RESULT="";
    RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);      
    if (RegDBGetKeyValueEx (szKey, szNumName, nvType, svNumValue, nvSize) < 0) then
    else
            RESULT= svNumValue;
      
    endif;
    return RESULT;
    
end;
                  
function STRING GetRegistryValue2(szKey,szNumName)
	STRING RESULT,svNumValue;  
    NUMBER  nvType, nvSize;



begin            
    
    RESULT="";
    RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);      
    if (RegDBGetKeyValueEx (szKey, szNumName, nvType, svNumValue, nvSize) < 0) then
    else
            RESULT= svNumValue;
      
    endif;
    return RESULT;
    
end;

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: