Create RegistryKey

//===========================================================================
//
//  Topic:    CreateRegistryKey
//
//  Description: 
//
//  My Name    : 
//
//===========================================================================

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
 	else
		   if (RegDBSetKeyValueEx (szKey, szNumName, nType, szNumValue, nSize) < 0) then
		     else
		   endif;
    endif;    
    if blnWillBeDeleteWhenUninstall=FALSE then
    	Enable(LOGGING);
    endif;
end; 

After called Function.

        szNumName  = INSTANCE_NAME;
	szNumValue = "1";
	nType      = REGDB_STRING;
	nSize      = -1;                              
	szKey = "SOFTWARE\\PRODUCT\\Demo" ;
	CreateRegistryKey(szKey, szNumName, nType, szNumValue, nSize,TRUE);

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: